Open dd2912 opened 3 years ago
Hi, thanks for your interest in the repo.
I didn't encounter this error. Can you send me the full error log so that I can try to understand what might be the issue? Did you able to run the inference on lower resolution videos (e.g. the example video in the repo)?
Loading weights for net_encoder Loading weights for net_decoder [ERROR:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap.cpp (415) cv::VideoWriter::open VIDEOIO(CV_IMAGES): raised OpenCV exception:
OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): output in function 'cv::icvExtractPattern'
Traceback (most recent call last):
File "inference.py", line 46, in
I also have this problem ,Have you ever encountered this issue?
Hi, so using the example video frame which is of size 352 × 288
works fine but for using any other input stream of video it seems to break and throws the same error as above. Could you please help with that @ozantezcan ?
And there are places in the code where you change h,w
to valid_h, valid_w
with this int(h / 16) * 16
, could you please help me understand what does it do and why do we need it?
I have the same problem. Everything works if input video has the resolution of 352x288 like the example videos. It does not work with other resolutions.
The VideoLoader class in data_loader.py reads all frames and resizes them to 288x352 resolution. I managed to make it work by modifying the def __readRGB method as follows:
def __readRGB(self, path): assert os.path.exists(path), "{} does not exist".format(path) im = cv2.cvtColor(cv2.resize(cv2.imread(path), self.size), cv2.COLOR_BGR2RGB).astype(np.float)/255
where self.size is (256, 256) in my case. This works for me on videos and frames of different resolution.
When I run the model on a video of 576x1008, I get the following error:
RuntimeError: torch.cat(): Sizes of tensors must match except in dimension 0. Got 288 and 576 in dimension 1 (The offending index is 2)
Have you ever encountered this issue? If so, do you have a fix for that?
Thanks