Giter VIP home page Giter VIP logo

Comments (9)

yuval-alaluf avatar yuval-alaluf commented on June 15, 2024

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.

from sam.

MetiCodePrivateLimited avatar MetiCodePrivateLimited commented on June 15, 2024

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?

from sam.

yuval-alaluf avatar yuval-alaluf commented on June 15, 2024

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?

from sam.

MetiCodePrivateLimited avatar MetiCodePrivateLimited commented on June 15, 2024

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"?

from sam.

yuval-alaluf avatar yuval-alaluf commented on June 15, 2024

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.

from sam.

MetiCodePrivateLimited avatar MetiCodePrivateLimited commented on June 15, 2024

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

from sam.

yuval-alaluf avatar yuval-alaluf commented on June 15, 2024

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.

from sam.

MetiCodePrivateLimited avatar MetiCodePrivateLimited commented on June 15, 2024

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
from models.psp import pSp
File "./models/psp.py", line 12, in
from models.encoders import psp_encoders
File "./models/encoders/psp_encoders.py", line 8, in
from models.stylegan2.model import EqualLinear
File "./models/stylegan2/model.py", line 7, in
from models.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
File "./models/stylegan2/op/init.py", line 1, in
from .fused_act import FusedLeakyReLU, fused_leaky_relu
File "./models/stylegan2/op/fused_act.py", line 13, in
os.path.join(module_path, 'fused_bias_act_kernel.cu'),
File "/root/anaconda3/envs/sam_env/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 974, in load
keep_intermediates=keep_intermediates)
File "/root/anaconda3/envs/sam_env/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1179, in _jit_compile
with_cuda=with_cuda)
File "/root/anaconda3/envs/sam_env/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1251, in _write_ninja_file_and_build_library
check_compiler_abi_compatibility(compiler)
File "/root/anaconda3/envs/sam_env/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 248, in check_compiler_abi_compatibility
if not check_compiler_ok_for_platform(compiler):
File "/root/anaconda3/envs/sam_env/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 208, in check_compiler_ok_for_platform
which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT)
File "/root/anaconda3/envs/sam_env/lib/python3.6/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/root/anaconda3/envs/sam_env/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['which', 'c++']' returned non-zero exit status 1.

from sam.

MetiCodePrivateLimited avatar MetiCodePrivateLimited commented on June 15, 2024

I solved it myself

from sam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.