-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to detect video #485
Comments
I have the same question! |
The problem is 'RuntimeError: Expected 4-dimensional input for 4-dimensional weight [32, 3, 3, 3], but got 3-dimensional input of size [480, 640, 3] instead' when I try to transform the frame image to tensor, but it occurs the error above. |
|
I think the way to modify the code is wrong, I also struggling for it. I also find other yolov3 on Github, but it doesn't show in good quality. |
Could you tell me what yolov3 you are using? Thanks a lot |
|
I appreciate you can share this one. |
I think you may have misunderstood what I mean, because I couldn't test the video, so I directly changed yolov3 and used the code of the link blogger above, which contains the command to test the video directly. |
alright. |
from future import division from models import * import os from PIL import Image import torch import matplotlib.pyplot as plt if name == "main":
I write a simple vedio base on this |
@Guardian-Li It looks like to be similar to my code, but how do you solve the problem called: |
@Guardian-Li almost the same code |
@Guardian-Li Is the frame must be resized? |
the Tensor you change from image must be use imgTensor = imgTensor.unsqueeze(0) |
you should add one dimension |
and cv2.imread is BRG ,PIL image read is RGB . |
你那个张量最后加到model里面的之前给他加一个维度就行了 |
@Guardian-Li 原来是中国人😂 好的 谢谢你 |
我看你简介的 没事 能跑就行 |
嗯 我去改改我的代码 |
@Guardian-Li 可以了 可以使用视频检测了 感谢帮助! |
没事 |
@Guardian-Li @PommesPeter Did you solve it? I need the detect.py file for this repo to detect video. |
@Guardian-Li @PommesPeter is there a working detect.py that works for video? The python code posted above by @Guardian-Li, is that working code? |
@aditjha it works, I follow his/her code and my understanding of the code, and i make it. |
@impravin22 Yes, I solve this problem. I follow his/her(@Guardian-Li ) code and I make it |
@impravin22 it's a working code |
@PommesPeter Great. Can you please send your detect.py if you dont mind. Thanks. |
@PommesPeter thank you for replying! Also, I am new to all this...using yolo for a project...so this detect.py allows for a recorded video to be inferenced correct? |
@PommesPeter Yeah I found it. It is as video.py in @Guardian-Li repo, isn't it? Thank you very much |
@impravin22 yes, my code is the same as his/her code |
@PommesPeter Thank you very much |
@aditjha I also the new to this project, you can read the source code over and over again to understand how it works. |
@impravin22 My pleasure! |
@PommesPeter yes, I will do so! quick question, in @Guardian-Li repo, i can see a vedio.py, but is the detect.py specific for videos or is the detect.py the same as the main repo |
the detect.py have a different from video.py. In @Guardian-Li 's repo, his/her detect.py is the same as the main repo. the video.py is the key to dectect video or camera |
@PommesPeter thank you! if I am trying to implement this repo along with @Guardian-Li 's video.py, will simply downloading her video.py work with this repo? Or did you have to download her repo and use everything from her repo? |
@aditjha it can be used in every yolo detection. |
How @Guardian-Li code change to only detect humans? |
If I want to test local video or webcam video, how should I modify it?
The text was updated successfully, but these errors were encountered: