Deep-Flow-Guided-Video-Inpainting icon indicating copy to clipboard operation
Deep-Flow-Guided-Video-Inpainting copied to clipboard

Mask conversion; Derived project

Open RexBarker opened this issue 4 years ago • 1 comments

Mask issue

I had one technical issue... in OpenCV4, the masks read with "cv2.IMREAD_UNCHANGED" converts RGB encoded masks into np.bool types with insufficient channels. This causes many problems later. Without this argument, the masks are read as a expected (as np.uint8, as 3-channel RGB)

line 76-77 in dataset/FlowInitial.py :

    #  --> fails; converts to np.bool, shape ( x, y)
    #tmp_mask = cv2.imread(mask_dir[i],  cv2.IMREAD_UNCHANGED)	
 
    # --> correct with OpenCV4; reads as np.uint8, shape (x,y,3)
    tmp_mask = cv2.imread(mask_dir[i])

Derived Project

Great project! I made a derivative project based on your models which automatically generates the masks using Detectron2. Additionally, I added a web app to allow easier setup:

https://github.com/RexBarker/VideoObjectRemoval

Video Object Removal Project

RexBarker avatar Nov 08 '20 22:11 RexBarker

Hi @RexBarker , about the problem in mask processing, I think it is related to the saved type and how to deal with the masks. You may customize the pre-processing as you want.

BTW, thanks for your derived project!

nbei avatar Nov 09 '20 03:11 nbei