Skip to main content

A deeplearning package for the basegun weapon recongition app

Project description

Project description

Basegun_ml is a deeplearning package for the basegun weapon recongition app.

Usage

Classification

from basegun_ml.classification import get_typology, list_typologies
#After the import the model is already warmed-up for faster inference

#Convert image to bytes
with open("test.jpg", "rb") as file:
    image_bytes = file.read()

#Prediction of the weapon typology
typology,confidence_score,confidence_level=get_typology(image_bytes)

#Obtain the list of the different typologies
list_typologies()

Variables description

  • typology: it corresponds to the weapon class predicted from the image. The list of typologies can be obtained from the function
  • confidence_score: it corresponds to the confidence of the class prediction of the algorithm, the closer to 1 to more confident is the prediction
  • confidence_level: there are 3 level of confidence defined. According to this performance level the basegun user will have more information.

    Measure length

    from basegun_ml.measure import get_lengths
    
    #Convert image to bytes
    with open("test.jpg", "rb") as file:
        image_bytes = file.read()
    
    #Get lengths
    weapon_length,barrel_length,confidence_card=get_lengths(image_bytes)
    

    Variables description

  • weapon_length: it corresponds to the weapon overall length predicted from the image.
  • barrel_length: it corresponds to the barrel length of the weapon predicted from the image.
  • confidence_card: it corresponds to the confidence score for the card prediction. A card is used as a reference for the measure module

    Tests

    Tests are available for the classification task and the measure length task

    pytest tests/test_classification.py 
    pytest tests/test_measure.py
    

    Credits

  • Project details


    Download files

    Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

    Source Distribution

    basegun_ml-1.0.1.tar.gz (15.1 MB view hashes)

    Uploaded Source

    Built Distribution

    basegun_ml-1.0.1-py3-none-any.whl (15.1 MB view hashes)

    Uploaded Python 3

    Supported by

    AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page