PeterL1n / BackgroundMattingV2

Real-Time High-Resolution Background Matting
MIT License
6.81k stars 950 forks source link

It got nothing when I run inference_images.py #113

Closed SanjunLiu closed 3 years ago

SanjunLiu commented 3 years ago

PATH_TO_CHECKPOINT=pytorch_resnet50.pth PATH_TO_IMAGES_SRC_DIR=./scripts/forground_image.jpg PATH_TO_IMAGES_BGR_DIR=./scripts/background_image.jpg PATH_TO_OUTPUT_DIR=./tmp/ output_type=com python inference_images.py \ --model-type mattingrefine \ --model-backbone resnet50 \ --model-backbone-scale 0.25 \ --model-refine-mode sampling \ --model-refine-sample-pixels 80000 \ --model-checkpoint ${PATH_TO_CHECKPOINT} \ --images-src ${PATH_TO_IMAGES_SRC_DIR} \ --images-bgr ${PATH_TO_IMAGES_BGR_DIR} \ --output-dir ${PATH_TO_OUTPUT_DIR} \ --output-type ${output_type}

The output dir is empty: ./tmp/com/nothing

PeterL1n commented 3 years ago

Sorry for the confusion. --images-src and --images-bgr expect directories not files. So you should create two directories and move your input and background images to the directory with the same name. For example, /src/image.png and /bgr/image.png

root12321 commented 2 years ago

Sorry for the confusion. --images-src and --images-bgr expect directories not files. So you should create two directories and move your input and background images to the directory with the same name. For example, /src/image.png and /bgr/image.png

i have a question ,if i just have a src img ,how to Image matting? if i have a backbound img and a src img,i think this work will be meaningless @PeterL1n

PeterL1n commented 2 years ago

@root12321 https://github.com/PeterL1n/RobustVideoMatting