github地址 : 771979972/paddle-SAM (github.com)
1、介绍:
输入一张图片,生成关于这个人不同年龄段的图片
2、下载模型
文章百度链接提供
3、配置环境
conda create -n sam python=3.8
conda activate sam
pip install scipy==1.4.1 -i https://mirror.baidu.com/pypi/simple
pip install matplotlib==3.2.1 -i https://mirror.baidu.com/pypi/simple
pip install tqdm==4.46.0 -i https://mirror.baidu.com/pypi/simple
pip install numpy==1.18.4 -i https://mirror.baidu.com/pypi/simple
pip install opencv-python==4.2.0.34 -i https://mirror.baidu.com/pypi/simple
pip install Pillow==10.0.1 -i https://mirror.baidu.com/pypi/simple
pip install torch-1.10.0+cu113-cp38-cp38-win_amd64.whl
pip install torchvision-0.11.0+cu113-cp38-cp38-win_amd64.whl
pip install paddlepaddle-gpu==2.5.1.post112 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html
4、运行
python scripts/inference_side_by_side.py --exp_dir=output --checkpoint_path=sam_ffhq_aging.pdparams --data_path=img --test_batch_size=4 --test_workers=4 --target_age=0,10,20,30,40,50,60,70,80,90,100