Home > Preparation > Preparation for Photorealistic Avatars evaluation
Follow the steps below to prepare the avatar test setup. Examples for all resource files (steps 1-4) are provided in the sample_inputs directory. To prepare the samples we used [LivePortrait].
Note: Ensure that you first complete the steps listed in the general preparation process.
Note: Processed Video Sequences (PVS) should be encoded in formats supported by major web browsers. For a list of supported encodings, refer to this guide. You can use FFmpeg for encoding.
For details about the different test methods for Photorealistic Avatars, please refer to the accompanying paper. This repository provides two templates as described in the paper:
- Template A: A no-reference method where participants rate their agreement with 8 statements after watching only the avatar video. The scale ranges from Strongly Disagree (1) to Strongly Agree (5).
- Template B: A full-reference method where participants rate their agreement with 3 statements after watching both the avatar video and the driving video. The scale ranges from Strongly Disagree (1) to Strongly Agree (5).
-
Upload PVS Clips
Upload your PVS clips to a cloud server and make them publicly accessible. Use the URLs to create therating_clips.csvfile with a column namedpvs. Each row should contain the URL of a PVS (see rating_clips_avatar_a.csv for an example).If using
Template B, horizontally stack the avatar video and the driving video so that the avatar video appears on the left and the driving video on the right. The resulting video becomes thepvsfor Template B. See rating_clips_avatar_b.csv for an example. Below is a sample FFmpeg command:ffmpeg -i avatar_1.mp4 -i real_video_1.mp4 -filter_complex "hstack" pvs1.mp4Important Notes:
- Ensure that CORS is enabled on your server:
Access-Control-Allow-Origin: *. - It is strongly recommended to set up a Content Delivery Network (CDN) to improve video loading times for participants. This applies to all other video materials mentioned below.
- File names/URLs: Clip file names will be used as unique keys in the analysis and will appear in the results. If you have 'conditions' represented by multiple clips, consider including the condition name in the file name (e.g.,
xxx_c01_xxxx.mp4). Providing the corresponding pattern allows the analysis script to aggregate results over conditions.
- Ensure that CORS is enabled on your server:
-
Upload Training Gold Clips
Upload your training gold clips to a cloud server and create theavatar_training_clips_a.csvfile, which contains all URLs in a column namedtraining_pvs(see avatar_training_clips_a.csv for examples).Hints:
- Training clips are used to anchor participants' perceptions and should represent the entire dataset. They should approximately cover the range from worst to best quality on different scales. It is recommended to use up to 5 clips.
- For avatar evaluations, training gold clips include feedback for participants based on their answers. Provide the correct answer for each question in the
*_ansfield, the acceptable tolerance in the*_varcolumn, and the corresponding message for out-of-range ratings in the*_msgcolumn. Leave the*_anscell empty if any rating is acceptable. See the example files for more details.
-
Upload Gold Standard Clips
Upload your gold standard clips to a cloud server and create thegold_clips.csvfile with the following columns:gold_clips_pvs: URL to the processed video clip.gold_clips_ans: The correct answer expected from participants. Since avatars have multiple scales, provide the correct answers as a comma-separated list (e.g.,(scale1_ans, scale2_ans, scale3_ans)). For Template B, an example answer could be(5,5,5). Use_as a placeholder for scales without a correct answer (e.g.,(5,_,5)). The order of scales should match the configuration file explained later in this document.
See avatar_gold_clips_b.csv for an example.
Hint: Gold standard clips are hidden quality control items. Their answers should be so obvious that all participants provide the correct rating (±1 deviation is accepted). Use clips with extreme quality levels (e.g., strongly agree - 5, or strongly disagree - 1) for each scale.
-
Create Trapping Stimuli
- Copy the sample configuration file
src\configurations\trappings.cfgand adapt it. See configuration of create_trapping_clips script for more details. - Create a
tp_srcdirectory and add clips from your dataset. Ensure the selection:- Covers a fair distribution of clips.
- Includes a range of quality levels (good, fair, and bad).
- Run the
create_trapping_clips.pyscript:cd src\utilities pip install -r requirements.txt python create_trapping_clips.py ^ --source tp_src ^ --des tp_out ^ --cfg your_config_file.cfg ^ --avatar
- Trapping clips will be stored in the
tp_outdirectory. The list of clips and their correct answers can be found intp_out\trapping_output_report.csv.
- Copy the sample configuration file
-
Upload Trapping Clips
Upload your trapping clips to a cloud server and create thetrapping_clips.csvfile with the following columns:trapping_pvs: URLs of the trapping clips.trapping_ans: Expected answers for each clip.
See avatar_trapping_clips_a.csv for an example.
-
Create Your Custom Project
-
Copy the sample configuration file
src\configurations\master.cfgand adapt it. See master script configuration for more details, especially the sections dedicated to Avatar, where you specify the template to use and other settings. -
Run the master script with all the resources prepared above. For example:
cd src python master_script.py ^ --project YOUR_PROJECT_NAME ^ --method avatar ^ --cfg your_configuration_file.cfg ^ --clips rating_clips.csv ^ --training_gold_clips training_clips.csv ^ --gold_clips gold_clips.csv ^ --trapping_clips trapping_clips.csvNote: File paths should be relative to the current working directory.
Optional flags:
--check_urls: Validates that all URLs in the clip, training, gold, and trapping CSV files are accessible.--create_local_test: Generates a local preview HTML file after the project is created, useful for testing before deployment.
-
Verify the script's output. A folder named
YOUR_PROJECT_NAMEwill be created in the current working directory, containing:YOUR_PROJECT_NAME_acr.html: Customized HIT app for Amazon Mechanical Turk (AMT).YOUR_PROJECT_NAME_publish_batch.csv: List of dynamic content for publishing the batch in AMT.YOUR_PROJECT_NAME_avatar_result_parser.cfg: Configuration file for theresult_parser.pyscript.
-
You are now ready to proceed with Running the Crowdsourcing Test.