tasks/classify/ #7960
Replies: 14 comments 27 replies
-
I have a pretrained model that can do detection and segmentation with my custom dataset, Can the model continue be trained for classification purpose, and predicts by passing the |
Beta Was this translation helpful? Give feedback.
-
I think you need to modify the dataset structure to be compatible with Detection as @pderrenger stated and might need to use |
Beta Was this translation helpful? Give feedback.
-
i want solo object detection code for video then want to merge my object half identification code status = False
|
Beta Was this translation helpful? Give feedback.
-
I trained a yolov8-l classification model where I was perform classification on some images, few months back it was working perfectly fine, was classifying accurately, but few days ago, when I ran the model again on an image I got an error, something like this This is the code, where I am loading a trained model .pt file from ultralytics import YOLO model = YOLO('/content/drive/MyDrive/best.pt') And Getting error like this: AttributeError Traceback (most recent call last) 9 frames AttributeError: shape Cant figure out this error, Kindly If anyone could help with this. |
Beta Was this translation helpful? Give feedback.
-
i have 73 bad images and 4000 good images, can yolov8 work for this or not (For classification problem), if yes , then what i will do ? |
Beta Was this translation helpful? Give feedback.
-
What are the main differences in the model architecture of Classify and Detect? |
Beta Was this translation helpful? Give feedback.
-
Hi there! TL;DR - After debug into train.py & predict.py, realized the images are resized + cropped strangely from what I gathered in the docs/forums, even with specified imgsz and rect=True. Full explanation - Training was : Expectations : (Even when I tried to do imgsz as a tuple - (h,w) aka (292,1216), a warning showed up, telling me the imgsz will be automatically selected to 1216, as it should have been an integer.. not a tuple.) What actually happened : Meaning, what previously was image of size 1216x292, turned into image of size 5063x1216 (This is due to Resize transformation of pytorch) And its not over - the data taken was only the INNER 1216x1216 - less than 1/4 of the actual data.. (This is due to CenterCrop transformation of pytorch) So, basically, I am asking - Is there a quote from the docs I have missed that said classify must be square sized? Or is there another way (except from padding to 1216x1216 - adding 924 black pixels to the height), to make classify work with rectangular images? Thank you so much, and sorry if I wasnt clear.. hopefully it was. |
Beta Was this translation helpful? Give feedback.
-
Hi, I have identified a small issue in the example provided for training in the classification task, which is 'results = model.train(data='mnist160', epochs=100, imgsz=64)'. The parameter 'imgsz' should actually be 640. |
Beta Was this translation helpful? Give feedback.
-
When I try to train my custom data, it raised Runtime Error
while in my yaml file is
why it did not go into train folder? |
Beta Was this translation helpful? Give feedback.
-
Hello, ı hope your day is going well.
I run this code and ı get max 0.764 acc. I want to improve my acc value. I changed optimizer but it did not improve. What should ı do. Please help me :(( Load a modelmodel = YOLO("yolov8x-cls.pt") # load a pretrained model Train the model and save the resultsresults = model.train(data='/content/data', epochs=200, imgsz=224, scale=0) |
Beta Was this translation helpful? Give feedback.
-
How would i write a custom loss function to be used only during training, and the default loss for validation? I tried this in tasks.py def init_criterion(self):
"""Initialize the loss criterion for the ClassificationModel."""
return v8ClassificationCustomLoss(self) if self.training else v8ClassificationLoss() |
Beta Was this translation helpful? Give feedback.
-
Hello, can a pretrained detection model be modified and applied to a classification task? |
Beta Was this translation helpful? Give feedback.
-
Rewrite: I have an image classification use case where the images could belong to class 1 or class 2, both class 1 and class 2 and neither. What's the best way to setup this classification using ultralytics image classifiers? Currently I have 4 folders class 1, class2, both, neither. Can you provide suggestions? |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
tasks/classify/
Learn about YOLOv8 Classify models for image classification. Get detailed information on List of Pretrained Models & how to Train, Validate, Predict & Export models.
https://docs.ultralytics.com/tasks/classify/
Beta Was this translation helpful? Give feedback.
All reactions