johnolafenwa / DeepStack

The World's Leading Cross Platform AI Engine for Edge Devices
Apache License 2.0
675 stars 105 forks source link

Model sharing #59

Closed odd86 closed 3 years ago

odd86 commented 3 years ago

Hello, i made a model to get licence plates from cars so its ready to be used for OCR On my 50 picture test it found 48 plates (many hard pictures i had never thouth it would get).

How can i share this .pt file with other deepstack users that needs to get licenceplates?

OlafenwaMoses commented 3 years ago

@odd86 Thank you very much for posting this. We currently don't have a trained model sharing platform yet. However, you can share the model using any of the options below:

odd86 commented 3 years ago

@OlafenwaMoses I will make a step-by-step guide for it! Its nice with custom models and maybe we can make a section in the forum for it? I`m currently using deepstack and pytessaact and building a system for home-cam automation with push notifications and a frontend for merging/adding new people and cars. I will come back with the source code for it when I have cleaned up the code and made it easy to run.

I must say i find the work you and your team are doing inspiring! and if it wasn’t for deepstack non of this would have been made since the learning curve would started to high up!

odd86 commented 3 years ago

Actualy you guide here: https://docs.deepstack.cc/custom-models/datasetprep/index.html is very accurate. The only thing i needed to figure out myself was some of the commands in colab:

After i installed the deepstack trainer, the command: unzip my-dataset.zip -d my-dataset dont work, so i need to do it like this:

add new code line and run:

import zipfile
with zipfile.ZipFile('/content/my-dataset.zip.zip', 'r') as zip_ref:
    zip_ref.extractall(/content/my-dataset)

and on this command: !python3 train.py --dataset-path "my-dataset"

I needed to add: !python3 train.py --dataset-path "/content/my-dataset"

So except those small things, the toturial you have is quite good!

OlafenwaMoses commented 3 years ago

We are glad you find DeepStack really useful and easy to use for your AI-driven home-cam automation.

We do appreciate the ingenuity you are putting to implement this incredible and intelligence setup. The global technology and IoT community needs more like it.

Once you have the article ready, feel free to drop the link here and especially on the DeepStack Forum.

odd86 commented 3 years ago

I just have one question that I’m really wondering about. For face recognition, what is best in these 2 scenarios:

For training:

  1. The whole picture
  2. The Person
  3. The Face

For recognition:

  1. The whole picture
  2. The Person
  3. The Face
The whole picture The Person The Face
OlafenwaMoses commented 3 years ago

Any of the images will work for both scenarios as DeepStack will automatically crop the face out of the picture before running face registration/recognition.

odd86 commented 3 years ago

Would more images of a person get you higher confidence? Rigth now im using 75 images, but often it detects me as unknown

robmarkcole commented 3 years ago

@OlafenwaMoses I think it would be great to have a page on the documentation for models contributed by the community. We would have an index and a short description of the model, and overview of the training data, and a link to any code/repo. We could also host the model in an LFS repo. Any thoughts?

odd86 commented 3 years ago

I can upload the model and the data to a github repo together with an explanation on how to get it working

odd86 commented 3 years ago

Then i added the repo with some instructions: deepstack licenceplate model

OlafenwaMoses commented 3 years ago

Would more images of a person get you higher confidence? Rigth now im using 75 images, but often it detects me as unknown

Using tens of images does facilitate higher confidence. However, it is important that the images are diverse to cater for multiple lighting conditions and perspectives.

OlafenwaMoses commented 3 years ago

@OlafenwaMoses I think it would be great to have a page on the documentation for models contributed by the community. We would have an index and a short description of the model, and overview of the training data, and a link to any code/repo. We could also host the model in an LFS repo. Any thoughts?

That sounds really good. In addition to this, we plan on listing the community trained models on DeepStack's Dev Center ( https://dev.deepstack.cc/ ). The purpose of the Dev Center is to provide overview and links to all of DeepStack's resources in the community such as the documentations, integrations, articles, trained models and projects built on DeepStack.

OlafenwaMoses commented 3 years ago

Then i added the repo with some instructions: deepstack licenceplate model

This is perfect @odd86 . Thank you for setting this up so fast and sharing with the community. We will include this in DeepStack's documentation, Dev Center and publications.

OlafenwaMoses commented 3 years ago

cc: @johnolafenwa

odd86 commented 3 years ago

@OlafenwaMoses Happy to help! Also think some of the questions i have gotten answers from you about here should be listet someplace since i think that theese are FAQ`s deepstack users will have :)

OlafenwaMoses commented 3 years ago

That will be great. We will setup a Developer FAQ in the documentation. Thanks for the suggestions @odd86

OlafenwaMoses commented 3 years ago

@odd86 Developer FAQ now available.

https://docs.deepstack.cc/faq/

Also list of custom models

https://docs.deepstack.cc/custom-models-samples/

OlafenwaMoses commented 3 years ago

@OlafenwaMoses I think it would be great to have a page on the documentation for models contributed by the community. We would have an index and a short description of the model, and overview of the training data, and a link to any code/repo. We could also host the model in an LFS repo. Any thoughts?

Done. Thanks very much @robmarkcole

https://docs.deepstack.cc/custom-models-samples/

manalishi70 commented 2 years ago

Would more images of a person get you higher confidence? Rigth now im using 75 images, but often it detects me as unknown

@odd86 : I have a similar behavior. Do you have any additional experience in training faces you can share?

manalishi70 commented 2 years ago

Using tens of images does facilitate higher confidence. However, it is important that the images are diverse to cater for multiple lighting conditions and perspectives. @OlafenwaMoses: I registered just one userid with 30 images. Faces of the person on the images are from different viewpoints. Images are taken in darker and lighter environment. When I run a recognition with exactly the same faces. Confidence is between 0.5 and 0.72. I put 2 unregistered persons inbetween and recognition shows similar confidence values. Is this the expected behavior or did I chosse images for registration which are too different?