w yl
Fantastic Job on the article. But please change the variable for second loop under 6B (Removing the background from all frames and saving them). This is causing issue later where only a single image is being saved and overridden after conversion to RGBA
Hey man I need your help! Great work on this by the way it's amazing for us video editors, but i'm having trouble near the last part of the code. I'm definitely not an avid coder here at all so let me know what I'm doing wrong. Everything looks like it activated correctly but when I get towards this part:
When I try to run that code, this error comes up:
NameError Traceback (most recent call last)
<ipython-input-7-ad0006e31003> in <module>() 32 ht,wd,l=final_img.shape 33 sz=(wd,ht) ---> 34 img_array.append(final_img)
NameError: name 'img_array' is not defined
From that point on, I am totally stuck here and can't finish the process because I don't know what this means or how to fix it. However, from what I can see, everything before that has activated successfully.
If you know how to fix this part for me, I'd greatly appreciate it! Thank you
Hello. 6B does not work. With the original file input.mp4 also does not work, output.mp4 is created but it is always the same size 23k and does not open. Although the frames in input_frames output_frames u2net_results are rendered correctly, there is some problem when assembling the video outv.write (i)
error Traceback (most recent call last)
in () 6 original=cv2.imread('/content/gdrive/MyDrive/background_removal_DL/test_data/videos/input_frames/input'+str(i)+'.png') 7 #subimage ----> 8 subimage=cv2.subtract(u2netresult,original) 9 cv2.imwrite('/content/gdrive/MyDrive/background_removal_DL/test_data/videos/output_frames/output'+str(i)+'.png',subimage) 10
error: OpenCV(4.8.0) /io/opencv/modules/core/src/arithm.cpp:647: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'arithm_op'