senguptaumd / Background-Matting

Background Matting: The World is Your Green Screen
https://grail.cs.washington.edu/projects/background-matting/
4.78k stars 662 forks source link

Colab notebook #26

Closed loretoparisi closed 4 years ago

loretoparisi commented 4 years ago

Thank you for this amazing project! Due to the complexity to run the inference, it would be worth to have a Colab notebook like the recent [CVPR 2020] 3D Photography using Context-aware Layered Depth Inpainting

senguptaumd commented 4 years ago

Thank you for your suggestion. That is definitely on my TODO list.

petrusinov commented 4 years ago

I can’t download this repository in google colab. I would be very grateful if someone uploads this project to the laptop colab

senguptaumd commented 4 years ago

Andrey Ryabtsev, University of Washington, created a google colab for this project, where you can upload images and videos both. I did not get time to test it yet. Feel free to try it out and report any issue if they arise.

loretoparisi commented 4 years ago

@senguptaumd do you have the link? Thanks.

senguptaumd commented 4 years ago

https://gist.github.com/andreyryabtsev/243aa3eefa6e06891dda7b1583d1d08f

loretoparisi commented 4 years ago

@senguptaumd so it seems I'm almost here. It seems it cannot find

python3: can't open file 'test_segmentation_deeplab.py': [Errno 2] No such file or directory

Current dir is /content.

Schermata 2020-04-21 alle 15 06 43
loretoparisi commented 4 years ago

@senguptaumd solved that the repo clone failed. Now the test_segmentation_deeplab.py it's ok...

At this point I get an error

!CUDA_VISIBLE_DEVICES=0 python test_background-matting_image.py -m real-hand-held -i colab_inputs/input/ -o colab_inputs/output/ -tb colab_inputs/background/0001.png

with error:

CUDA Device: 0
Using image mode
Traceback (most recent call last):
  File "test_background-matting_image.py", line 46, in <module>
    back_img10=cv2.imread(args.target_back); back_img10=cv2.cvtColor(back_img10,cv2.COLOR_BGR2RGB);
cv2.error: OpenCV(4.1.2) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'
andreyryabtsev commented 4 years ago

Hi @loretoparisi ! The error most likely has to do with a missing file at colab_inputs/background/0001.png, -- were you able to upload this file? This would be the target background onto which to paste the resulting matte. You can also change that path in the cell if you named it something else.

loretoparisi commented 4 years ago

@andreyryabtsev yes it works thank you! It was due the a disconnected colab that deleted all upload contents!