abdelaziz-mahdy / pytorch_lite

flutter package to help run pytorch lite models classification and YoloV5 and YoloV8.
MIT License
49 stars 18 forks source link

custom model #71

Open ghost opened 4 months ago

ghost commented 4 months ago

I want to use my own yolo model it is for sign language detection.. I tried to just replace the model and labels paths but nothing appear.. No errors and also no label or bounding box. I don't know if there is something else needs to be changed This how I change the code:

image

here is what is the terminal keep showing:

image
abdelaziz-mahdy commented 4 months ago

Your model didn't detect any objects, the before processing part is all of the objects detected

Check your weights and the way you exported your model

ghost commented 4 months ago

Your model didn't detect any objects, the before processing part is all of the objects detected

Check your weights and the way you exported your model

How can i train the model? I have the imgs with their annotations and apply this python code to get .pt file

image

after that I convert best.pt into .torchscript using the line you provided !yolo mode=export model="your model" format=torchscript optimize

abdelaziz-mahdy commented 4 months ago

i dont see a problem with your code, can you try another model or other images

ghost commented 4 months ago

i dont see a problem with your code, can you try another model or other images

I have tried another model and its worked as expected, but the real time detection is too slow is their any way to improve it?

abdelaziz-mahdy commented 4 months ago

Sadly for now there is none, it's a limitation from pytorch it self, for the best speeds you will have to use tflite

ghost commented 4 months ago

Sadly for now there is none, it's a limitation from pytorch it self, for the best speeds you will have to use tflite

I already tried it but it requires flutter downgrade ,because it is not work with the latest flutter version 😢

abdelaziz-mahdy commented 4 months ago

Sadly the package is using the latest pytorch release for mobile and no GPU support yet😢

nqtworking commented 3 months ago

Hi @zezo357 , I'm a beginner in computer vision and Flutter. I'm wondering if your pre-made example has the ability to convert images from the camera to int8 format and then pass them to a YOLO model exported as int8 to improve processing speed?

abdelaziz-mahdy commented 3 months ago

The example does convert camera image to it's float32 format since that's the input for yolo yes

nqtworking commented 3 months ago

@zezo357 thanks for your feedback!