#๐Ÿ”’ I need help updating a yolo model

56 messages ยท Page 1 of 1 (latest)

sullen berry
#

I am currently working on a project which includes yolo object detection. I am currently using a database in yolov5, but I would like to change it to a different database in yolov8. I have the database, I am just unsure how to implement it into my project to replace the current one.

unkempt skiffBOT
#

@sullen berry

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

sudden kayak
#

So, by database do you mean weights?

sullen berry
#

self.model = torch.hub.load('ultralytics/yolov5', 'custom', path='lib/best.pt', force_reload = True)

#

this is how the database is loaded at the moment

#

no weights

#

but i would like to replace yolov5 with yolov8 and use a new pretrained database

#

which i have

#

are you able to help? @sudden kayak

sudden kayak
# sullen berry no weights

So the .pt file is usually regarded as the weights. It's not really a database as most people would think of a database.

#

You should just be able to repalce the path= argument with the new pre-trained weights file

sullen berry
#

i dont have the weights file

sullen berry
echo verge
#

The .pt file is the weights file

sudden kayak
#

For yolov8, what files do you have with it?

sullen berry
#

this is the dataset i would like to use

echo verge
#

Is this for malicious purposes?

sullen berry
#

no

sudden kayak
#

So you want to train and create your own new weights file using yolov8?

sudden kayak
sullen berry
#

there is no "malicious purpose" of this project, its just experimental

winter falcon
#

does it actually have any input on the game or is inserted in the game itself in anyway or is it being fed a screen capture?

sullen berry
#

it doesnt tamper with any files, it just detects players in a snippet of the screen

#

its very interesting to us

winter falcon
#

alright, i was asking because if it did it would break their tos making it so we arent allowed to help. as long as its only a snippet its fine

sullen berry
#

yeah there are no tampers with the game

#

we arent that stupid

sudden kayak
#

So, if you want to train a new thing with yolov8 and that dataset, then you need to replace the first argument with the actual yolov8 model. The starting weight file don't make a huuuge difference tbh if you're going to re-train if you tune your training well enough.

sullen berry
sudden kayak
#

what did you replace it with?

sullen berry
#

i cant remember, i have deleted it

#

i can try retrace it

sudden kayak
#

Well, do you have the yolov8 model downloaded/accessible?

sullen berry
#

i have downloaded it as a zip file

sudden kayak
#

So that's the weights file using the format yolov8 needs, but it's not the actual yolov8 model itself. Just the weights file trained with that dataset.

sullen berry
#

im sorry that i am so confused

#

how would i form the model

#

from the weights file

#

i need to make this into a model (.pt file)

https://universe.roboflow.com/james-pakis/fortnite-player-detection-hpiac/dataset/8

and integrate it so that pt file replaces the one in this

self.model = torch.hub.load('ultralytics/yolov5', 'custom', path='lib/best.pt', force_reload = True)

and change yolov5 to yolov8

sudden kayak
#

You can't. You need to download the yolov8 model from wherever it's originally hosted. The model can create the weights file after a sufficient amount of training.

From this: self.model = torch.hub.load('ultralytics/yolov5', 'custom', path='lib/best.pt', force_reload = True)

You should just need to repalce ultralytics/yolov5 with ultralytics/yolov8 (https://github.com/ultralytics/ultralytics)

sullen berry
#

i will try that now

#

doesnt work

sudden kayak
sullen berry
#

so would i replace

self.model = torch.hub.load('ultralytics/yolov5', 'custom', path='lib/best.pt', force_reload = True)

with

model = YOLO('best.pt') # load a partially trained model

#

after i have imported yolo from ultralytics of course

sudden kayak
#

I'm not familiar with using their platform, you'd have to follow their guide for using it

unkempt skiffBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.