ibaiGorordo / Tapir-Pytorch-Inference

Minimal code for Tapir model inference in Pytorch
Apache License 2.0
13 stars 2 forks source link

Error while trying the example #1

Open altineller opened 1 month ago

altineller commented 1 month ago

Hello,

Calling 'python3 example_video_tracking.py' causes:

`[youtube] Extracting URL: https://youtu.be/lOSgQxG_uqQ?si=QN8YiTFWbD4wnsS5 [youtube] lOSgQxG_uqQ: Downloading webpage [youtube] lOSgQxG_uqQ: Downloading ios player API JSON [youtube] lOSgQxG_uqQ: Downloading web creator player API JSON [youtube] lOSgQxG_uqQ: Downloading m3u8 information [youtube] lOSgQxG_uqQ: Downloading MPD manifest [ WARN:0@3.376] global cap.cpp:164 open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.10.0) /io/opencv/modules/videoio/src/cap_images.cpp:244: error: (-5:Bad argument) CAP_IMAGES: error, expected '0?[1-9][du]' pattern, got: https://manifest.googlevideo.com/api/manifest/dash/expire/1723578148/ei/xGK7ZtTeO93Ui9oPiMrS8AM/ip/95.8.196.10/id/94e4a04311bfbaa4/source/youtube/requiressl/yes/xpc/EgVo2aDSNQ%3D%3D/playback_host/rr6---sn-u0g3uxax3-pnu6.googlevideo.com/mh/2i/mm/31%2C29/mn/sn-u0g3uxax3-pnu6%2Csn-nv47zn7r/ms/au%2Crdu/mv/m/mvi/6/pl/21/hfr/all/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm2_sd_hd_clear/initcwndbps/978750/spc/Mv1m9qMqglwu-faDX8M-tZK8OZkhfxhbmf6FjoumQKsYYCMn_0izBvicurJZafk/vprv/1/rqh/2/mt/1723556007/fvip/3/keepalive/yes/itag/0/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Cxpc%2Chfr%2Cas%2Cspc%2Cvprv%2Crqh%2Citag/sig/AJfQdSswRQIgZituwx-R3uEz7m6CCx74fJu6nYp94QX-EEya6nYGB4UCIQC_Owy8cgqCLRVPQtkkNA6eW9AAw4mns4CXB-jBSX7RxQ%3D%3D/lsparams/playback_host%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps/lsig/AGtxev0wRAIgYNvOcIVq4gTvNK-QE3M2Ac5czwqQ_3TSUn1aZdqxQ4YCIGbxZ2x11zQZUzaPBQ1WDFQUbJxdKKbC7_t3FLtur2q7 in function 'icvExtractPattern'

Traceback (most recent call last): File "/home/can/Tapir-Pytorch-Inference/example_video_tracking.py", line 30, in tapir.set_points(frame, query_points) File "/home/can/Tapir-Pytorch-Inference/tapnet/tapir_inference.py", line 76, in set_points input_frame = preprocess_frame(frame, resize=self.input_resolution, device=self.device) File "/home/can/Tapir-Pytorch-Inference/tapnet/utils.py", line 150, in preprocess_frame input = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) cv2.error: OpenCV(4.10.0) /io/opencv/modules/imgproc/src/color.cpp:196: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor' `

Best Regards, Can

ibaiGorordo commented 1 month ago

The issue is with my other cap_from_youtube library, I will try to get it fixed, but for now modify the code to: cap = cap_from_youtube(videoUrl, resolution="1080p")