Closed MetiCodePrivateLimited closed 3 years ago
What machine are you running on? All of our work was done on Linux. If you plan working on windows I can help point you in the right direction, but I have never tried running on Windows myself.
Sorry for could not elaborate my issue right. I want to run your already trained model to transform Age Face effects. How can I run those scripts?
The README provides a pretty detailed step by step guide for how to run inference on a trained model. Is there a particular part that is not clear?
I am trying to execute following command after getting git clone of SAM project in my linux based system, cd /usr/local/SAM
and under SAM, following is the code: python scripts/reference_guided_inference.py \ --exp_dir=/path/to/experiment \ --checkpoint_path=experiment/checkpoints/best_model.pt \ --data_path=/path/to/test_data \ --test_batch_size=4 \ --test_workers=4 \ --ref_images_paths_file=/path/to/ref_list.txt \ --latent_mask=8,9 \ --target_age=50,60,70,80
Do I need to self create folders i.e. "path/to/experiment", "path/to/test_data", "path/to/ref"? Also, from where would I get "best_model.pt"?
Are you sure that scripts/reference_guided_inference.py
is the script you want to run? Are you trying to simply change a given image's age? If so, you should use the regular inference
script.
In any case, yes you need to define the exp_dir
which is where the outputs will be saved. The data path is the path to the directory holding the images you want to run on.
I provided the link for downloading the pretrained model in the README. You should download the model, save it to whatever path you want, and place the chosen path to checkpoint_path
.
What are the functionality of following parameters that are used in commands. 1) --test_batch_size=4 2) --test_workers=4 3) --latent_mask=8,9
The batch size is the number of images you pass through the network together and the number of workers is a parameter used by the dataloader (you don't need to worry about this one too much). The latent mask is used to perform style mixing. Here, we specify that we want to perform style mixing with a reference image on layers 8 and 9 of StyleGAN. Again, just make sure you're running the right script for inference. More details on the functionality of each script is provided in the README.
on the execution of following code, I got an error --****-- python3 scripts/inference.py \ --exp_dir= /to/experiment \ --checkpoint_path= /trainedmodels/sam_ffhq_aging.pt \ --data_path= /to/test_data \ --test_batch_size=4 \ --test_workers=4 \ --couple_outputs \ --target_age=0,10,20,30,40,50,60,70,80
--****--
Traceback (most recent call last):
File "scripts/inference.py", line 19, in
I solved it myself
After successfully configuration, how can I run trained model of SAM in my machine. Could you elaborate all steps in detail?