-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong Classification with custom model #43
Comments
Can you share your code, Also did you update the labels.txt? And for yolo no need to change the model the mean and std if you're using the default values, so can you test with the default? |
Can you share the model and test image if you can't share the code? Since i need something to test with if classification is wrong |
Certainly, I will provide the codes, model, and classes along with the image I am testing. Yes, I tested it with the mean and standard deviation values as well. For this attached image, the return class should be 'andorinha', but regardless of which image I use, it always returns the class 'objeto'. Here are some parts of my code. Gravacao.de.Tela.2023-09-19.as.16.02.45.mov |
Okay I see that all of your codes are correct, but I can't figure out why the results are not correct, Anyway I am working on a new release for iOS support and changing how the package reads and gets results so can you wait for new release? When I do I can further test why the classification is not correct, and improve it if I can. |
Of course, I will wait and conduct new tests with the new build. Thank you for your attention! |
Hello @zezo357, were you able to reproduce my code and test it? Do you need any additional information? If you can help with anything, please let me know, as I ran some tests and still have the same result. Thanks! |
I was not free lately, thank you for reminding me to test again sry for the wait I did try some stuff and changed variables without any useful results, so I will try some different normalization and see what works and let you know, still no promises that I will be able to make it work |
Meanwhile, I will continue running some tests. If there is progress, I will let you know. To improve reproduction, here are the codes used, original model, and converted model, along with the output tensors. https://drive.google.com/file/d/149grCV5f6vQkXw9j4xoDufcQN6LW3z1I/view?usp=share_link |
i have sent a request to access, hopefully i can figure something this weekend |
Access granted. Any news let me know. Thanks |
can you guys try on this branch? it maybe be the fix for the problem not sure, but lets see
|
Also sorry for asking but, can you provide a GitHub repo i can test on, instead of asking you to test? Just to be more efficient while testing and having the same configuration |
@zezo357 hello my friend! How you doing? I have shared with you the code we used to test pytorch_lite |
thank you will test and let you know if new fix is enough |
I'm sending the images in case I need to test with this model we generated |
@ebdjesus i cant find a way to test the model? the code is not using it? the camera icon prints the path, but doesnt run the classification function |
can you let me know how to run the model in your app ? |
my function final XFile? image = await _picker.pickImage(source: ImageSource.gallery);
print(image!.path);
Stopwatch stopwatch = Stopwatch()..start();
String textToShow = await _imageModel!
.getImagePrediction(await File(image.path).readAsBytes());
textToShow = "${textToShow ?? ""}, ${inferenceTimeAsString(stopwatch)}";
|
Did you close app and doing a pub get and rerun it after changing the models? Please set it model name as different name to make sure it's replaced correctly |
https://github.com/zezo357/pytorch_lite/tree/classifer-test this is the code i tested on and showed the results to you |
I deleted the .pub-cache and tried to clear everything, changed the name as you said and nothing. |
The model I used is the one in your repo, and it works correctly, And I did give you the branch I tested on, this is weird Please can you try on the branch I provided? |
I'll test it now with him. I'll get back to you. Thanks |
@zezo357 I have now tested it directly in my project and it is working very well. |
Glad to help and good luck , also don't be too harsh on him we all mess up sometimes. All we can do is learn from mistakes. |
I'm just kidding, he's largely responsible for us having this functionality today and you for making it possible to run this in the app. |
Hopefully all goes well, and don't hesitate to ask for assistance if needed |
Hello everyone.
I'm testing the implementation with a model trained by myself, and I'm facing some issues during the classification process. I had to modify the code to export the YOLO classification model, and I did it like this:
It seems like the export is working, but when I use it in Flutter, it always gets classified with the wrong class.\
In my case, my model was trained with only 3 classes, and I updated your code to accommodate this number of classes.
I also calculated the mean and standard deviation based on my dataset.
In addition to changing the number of classes in the code, do I need to make any other modifications in the code to use a custom model with a different number of classes?
The text was updated successfully, but these errors were encountered: