I don't know why cv2.rectangle causes errors #58842
Unanswered
leejoohi
asked this question in
Programming Help
Replies: 1 comment
-
The issue
How to fix ityou can achieve this by moving the
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Question
Body
`from _testinternalcapi import get_config
from django.shortcuts import render
from django.http import StreamingHttpResponse
import yolov8
import cv2
from collections import Counter
from PIL import Image as im
from ultralytics import YOLO
from ultralytics.yolo.utils.plotting import Annotator
from ultralytics.yolo.utils.torch_utils import select_device
Create your views here.
def index(request):
return render(request, 'index.html')
model = YOLO('best.pt')
def stream():
cap = cv2.VideoCapture(0)
while True:
ret, frame = cap.read()
if not ret:
print("Error: failed to capture image")
break
def video_feed(request):
return StreamingHttpResponse(stream(), content_type='multipart/x-mixed-replace; boundary=frame')`
**
We created a guest house detection learning model that detects colors through yolov8m. In this state, I wrote a code after watching YouTube for real-time guest house detection, but it doesn't work from cv2. correctangle. The error code is as follows.
**
OpenCV(4.7.0) 👎 error: (-5:Bad argument) in function 'rectangle'
**
Please let me know which one I should modify.
Beta Was this translation helpful? Give feedback.
All reactions