Skip to content
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

ip camera or web camera. error: (-215:Assertion failed) !ss ize.empty() in function 'cv::resize' #2709

Closed
xiaowo1996 opened this issue Apr 6, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@xiaowo1996
Copy link
Contributor

xiaowo1996 commented Apr 6, 2021

when i use detect.py in ip camera or web camera. I do resize function to img. the error appear (-215:Assertion failed) !ss ize.empty() in function 'cv::resize'. (i get the face bounding box and i resize it and input it in another model to interference )but if i use --source img/video(offline inference) ,it works perfely.

i just add the code in detect.py

cropped =im0[ int(box_y1):int(box_y2),int(box_x1):int(box_x2)]
img1 = cv2.resize(cropped,(112,112))

i just add this in detect.py .it can works well in offline interference but error in ip camera or web camera.

@xiaowo1996 xiaowo1996 added the bug Something isn't working label Apr 6, 2021
@glenn-jocher
Copy link
Member

glenn-jocher commented Apr 6, 2021

@xiaowo1996 👋 Hello, thank you for your interest in our work! This issue seems to lack the minimum requirements for a proper response, or is insufficiently detailed for us to help you. Please note that most technical problems are due to:

  • Your modified or out-of-date code. If your issue is not reproducible in a new git clone version of this repo we can not debug it. Before going further run this code and verify your issue persists:
$ git clone https://github.com/ultralytics/yolov5 yolov5_new  # clone latest
$ cd yolov5_new
$ python detect.py  # verify detection

# CODE TO REPRODUCE YOUR ISSUE HERE
  • Your custom data. If your issue is not reproducible in one of our 3 common datasets (COCO, COCO128, or VOC) we can not debug it. Visit our Custom Training Tutorial for guidelines on training your custom data. Examine train_batch0.jpg and test_batch0.jpg for a sanity check of your labels and images.

  • Your environment. If your issue is not reproducible in one of the verified environments below we can not debug it. If you are running YOLOv5 locally, verify your environment meets all of the requirements.txt dependencies specified below. If in doubt, download Python 3.8.0 from https://www.python.org/, create a new venv, and install requirements.

If none of these apply to you, we suggest you close this issue and raise a new one using the 🐛 Bug Report template, providing screenshots and a minimum reproducible example of your issue. Thank you!

Requirements

Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.7. To install run:

$ pip install -r requirements.txt

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are passing. These tests evaluate proper operation of basic YOLOv5 functionality, including training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu.

@xiaowo1996
Copy link
Contributor Author

xiaowo1996 commented Apr 10, 2021

@glenn-jocher hi , i get the newest by git clone. but the same error was appear.
all what i had done is i add two line code in detect.py in line 64 and line 65.
im1 = np.array(im0s.copy()) input = cv2.resize(im1, (112,112))
it can run successfully by python detect.py.but it failed by python detect.py -- source 0 or ip camera rstp camera
it is a important step for my code. my project can't detect by webcamera or ip camera. but it can detect by python detect.py offline interference. which is not conducive to project deployment.

@glenn-jocher
Copy link
Member

glenn-jocher commented Apr 10, 2021

@xiaowo1996 we only offer support for issues arising from the default repository code. If you believe you have a reproducible issue with unmodified code, we suggest you close this issue and raise a new one using the 🐛 Bug Report template, providing screenshots and a minimum reproducible example to help us better understand and diagnose your problem. Thank you!

@xiaowo1996
Copy link
Contributor Author

@glenn-jocher ok , I had solve the problem. i close this issue .the data from images or video is different from stream data. if you want do some operation to image from stream data use this, im1 = np.array(im0s[0].copy()).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants