Spaces:
Configuration error
Configuration error
Download models/FeatureStyleEncoder/run_video_inversion_editing.sh from miguelmuzo/HairSwapModel: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/spaces/miguelmuzo/HairSwapModel/resolve/main/models/FeatureStyleEncoder/run_video_inversion_editing.sh
- Command line
-
hf download hf://spaces/miguelmuzo/HairSwapModel/models/FeatureStyleEncoder/run_video_inversion_editing.sh
-
curl -L -o run_video_inversion_editing.sh https://huggingface.co/spaces/miguelmuzo/HairSwapModel/resolve/main/models/FeatureStyleEncoder/run_video_inversion_editing.sh
1.32 kB
| VideoName='FP010363HD03' | |
| Attribute='Heavy_Makeup' | |
| Scale='1' | |
| Sigma='3' # Choose appropriate gaussian filter size | |
| VideoDir='./data/video/' | |
| OutputDir='./output/video/' | |
| # Cut video to frames | |
| python video_processing.py --function 'video_to_frames' --video_path ${VideoDir}/${VideoName}.mp4 --output_path ${OutputDir} #--resize | |
| # Crop and align the faces in each frame | |
| python video_processing.py --function 'align_frames' --video_path ${VideoDir}/${VideoName}.mp4 --output_path ${OutputDir} --filter_size=${Sigma} --optical_flow | |
| # Inversion | |
| python test.py --config 143 --input_path ${OutputDir}/${VideoName}/${VideoName}_crop_align/ --save_path ${OutputDir}/${VideoName}/${VideoName}_inversion/ | |
| # Achieve latent manipulation | |
| python video_processing.py --function 'latent_manipulation' --video_path ${VideoDir}/${VideoName}.mp4 --attr ${Attribute} --alpha=${Scale} | |
| # Reproject the manipulated frames to the original video | |
| python video_processing.py --function 'reproject_origin' --video_path ${VideoDir}/${VideoName}.mp4 --seamless | |
| python video_processing.py --function 'reproject_manipulate' --video_path ${VideoDir}/${VideoName}.mp4 --attr ${Attribute} --seamless | |
| python video_processing.py --function 'compare_frames' --video_path ${VideoDir}/${VideoName}.mp4 --attr ${Attribute} --strs 'Original,Projected,Manipulated' | |