detection

Specify a class to detect using YOLOv8 on pre-trained model

Specify a class to detect using YOLOv8 on pre-trained model Question: I’m new to YOLOv8, I just want the model to detect only some classes, not all the 80 classes the model trained on. How can I specify YOLOv8 model to detect only one class? For example only person. from ultralytics import YOLO model = …

Total answers: 1

remove the element attached to the image border

remove the element attached to the image border Question: I’m using OpenCV to detect Pneumonia in chest-x-ray using Image Processing, so I need to remove the attached area to the image border to get the lung only, can anyone help me code this in python? This image explains what I want this image after applying …

Total answers: 2

Detect & Record Audio in Python – trim beginning silence

Detect & Record Audio in Python – trim beginning silence Question: Using the script in this answer, silence at the beginning of the recording is not clipped. I’m using python3. As I’ve actually slightly tweaked the script, here’s my copy: https://wtools.io/paste-code/b2tk from sys import byteorder from array import array from struct import pack import pyaudio …

Total answers: 1

Detect circles in openCV

Detect circles in openCV Question: I have a problem with choosing right parameters for HoughCircles function. I try to detect circles from video. This circles are made by me, and has almost the same dimension. Problem is that camera is in move. When I change maxRadius it still detect bigger circles somehow (see the right …

Total answers: 3

AttributeError: module 'cv2.cv2' has no attribute 'CascadeClassifer' (OpenCV Face Detection)

AttributeError: module 'cv2.cv2' has no attribute 'CascadeClassifer' (OpenCV Face Detection) Question: I have tried running this code for the OpenCV face detection and upon running it I get the error (AttributeError: module ‘cv2.cv2’ has no attribute ‘CascadeClassifer’) Is there some sort of new code I need to use? Error is on line 4 (face_cascade = …

Total answers: 3

Why pynput doesn't detect numeric keyboard presses?

Why pynput doesn't detect numeric keyboard presses? Question: I’m using python 3.7 on windows 7. Is there any way to detect number (for example: “1”) key presses in pynput module? I have tried many other modules and i got nothing except for tkinter which needs a window but i don’t want that. from pynput import …

Total answers: 4

Python: How can I find an image on screen by using: pyautogui lib?

Python: How can I find an image on screen by using: pyautogui lib? Question: The code is: import pyautogui startButton = pyautogui.locateOnScreen(‘start.png’) print startButton Or: import pyautogui startButton = pyautogui.locateCenterOnScreen(‘start.png’) print startButton The output is: None Note: the correct syntax seems to be in place according to the documentation. Note: I have tried also with …

Total answers: 6

NLTK and language detection

NLTK and language detection Question: How do I detect what language a text is written in using NLTK? The examples I’ve seen use nltk.detect, but when I’ve installed it on my mac, I cannot find this package. Asked By: niklassaers || Source Answers: Have you come across the following code snippet? english_vocab = set(w.lower() for …

Total answers: 5