yolo

Torch in python unable to get some layers like add from model structure

Torch in python unable to get some layers like add from model structure Question: I have this simple code to write down structure of network. model = torch.jit.load(‘best5.torchscript’) file_object = open(‘sample.txt’, ‘a’) for name, module in model.named_modules(): file_object.write(str(module)) Problem is that some layers like "add" is not present for example this is part from output …

Total answers: 1

Get all layers including operators from torch in python

Get all layers including operators from torch in python Question: I want to get all layers like convolution etc… and operator like "add" in python but I really dont know how. This is my code import torch # An instance of your model. model = torch.jit.load(‘best5.torchscript’) # Print all the layers for name, param in …

Total answers: 1

Application keeps crashing and is very laggy: IndexError: index 0 is out of bounds for dimension 0 with size 0

Application keeps crashing and is very laggy: IndexError: index 0 is out of bounds for dimension 0 with size 0 Question: import cv2 import argparse import pandas as pd from ultralytics import YOLO import supervision as sv import numpy as np from supervision.tools.detections import Detections, BoxAnnotator from supervision.tools.line_counter import LineCounter, LineCounterAnnotator from supervision.draw.color import ColorPalette …

Total answers: 2

OSError: [Errno 24] Too many open files: '/home/ec2-user/car/1016780737.jpg'

OSError: [Errno 24] Too many open files: '/home/ec2-user/car/1016780737.jpg' Question: I am doing predictions on 100K images using following yolov8 code: model = YOLO(self.weightpath) src_dir = self.src_Dir src_dir = src_dir+ ‘*’ img_list = glob.glob(src_dir) results = model(img_list, max_det = 1) I am getting following error: Traceback (most recent call last): File "/home/ec2-user/Deployment/main/Quality_check.py", line 63, in <module> …

Total answers: 1

How is the YOLOv8 best loss model selected by the trainer class?

How is the YOLOv8 best loss model selected by the trainer class? Question: From the YOLOv8 documentation, it is not clear to me which loss metric the YOLOv8 trainer class uses in determining the best loss model that is saved in a training run. Is it based on the validation or training loss? Specifically, when …

Total answers: 1

YOLOv8 get predicted bounding box

YOLOv8 get predicted bounding box Question: I want to integrate OpenCV with YOLOv8 from ultralytics, so I want to obtain the bounding box coordinates from the model prediction. How do I do this? from ultralytics import YOLO import cv2 model = YOLO(‘yolov8n.pt’) cap = cv2.VideoCapture(0) cap.set(3, 640) cap.set(4, 480) while True: _, frame = cap.read() …

Total answers: 4

YOLOv8 get predicted class name

YOLOv8 get predicted class name Question: I just want to get class data in my python script like: person, car, truck, dog but my output more than this. Also I can not use results as a string. Python script: from ultralytics import YOLO model = YOLO("yolov8n.pt") results = model.predict(source="0") Output: 0: 480×640 1 person, 1 …

Total answers: 2

yolo v8: does segment contain point?

yolo v8: does segment contain point? Question: I’m using yolo v8 to detect subjects in pictures. It’s working well, and can create quite precise masks over subjects. from ultralytics import YOLO model = YOLO(‘yolov8x-seg.pt’) for output in model(‘image.jpg’, return_outputs=True): for segment in output[‘segment’]: print(segment) The code above works, and generates a series of "segments", which …

Total answers: 1

How can I improve my dataset for increased mAP in yolov4 object detection framework

How can I improve my dataset for increased mAP in yolov4 object detection framework Question: I want to use Yolov4 object detector to detect LED matrices like the one in the attached picture. The goal of my project is to perform automated RoI of these types of LED matrices in vehicular scenarios, mainly. Unfortunately, these …

Total answers: 2