Closed KinjalParikh closed 3 years ago
I think there are some issues with your video file format that cannot be read.
Maybe try converting it to a common h.264 mp4 format.
I checked the codec information, and it was already in h264 format but I hadn't removed the audio stream. Works after removing the audio.
Thanks!
use full path like "/Users/amit/Desktop/test.mp4" apparantly opencv not enough abridged version of path
I uploaded a video file and background image and tried using BackgroundMattingV2-VideoMatting.ipynb, but it gives me the following error:
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xc5867600] moov atom not found VIDIOC_REQBUFS: Inappropriate ioctl for device 0% 0/1 [00:00<?, ?it/s]Traceback (most recent call last): File "inference_video.py", line 178, in
for src, bgr in tqdm(DataLoader(dataset, batch_size=1, pin_memory=True)):
File "/usr/local/lib/python3.6/dist-packages/tqdm/std.py", line 1104, in iter
for obj in iterable:
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 435, in next
data = self._next_data()
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/content/BackgroundMattingV2/dataset/zip.py", line 17, in getitem
x = tuple(d[idx % len(d)] for d in self.datasets)
File "/content/BackgroundMattingV2/dataset/zip.py", line 17, in
x = tuple(d[idx % len(d)] for d in self.datasets)
ZeroDivisionError: integer division or modulo by zero
0% 0/1 [00:00<?, ?it/s]
How can I resolve it?
Thanks!