GithubHelp home page GithubHelp logo

nopenix / ai-counter Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 1002 KB

Counts People on a Image and writes the Count to a MariaDB Database

License: Apache License 2.0

PowerShell 33.43% HTML 39.56% Python 27.01%

ai-counter's Introduction

AI-Counter

  • Counts specified Objects on a Image and writes the Count to a MariaDB Database.
  • Choose between different Models:
  • GPU Support
  • Configurable via Web Interface
  • REST API with Swagger Documentation for easy external Data Access.

Technology Stack

Tech Description
Docker
PowerShell Core
PowerShell Module Pode
Python
... AI Stuff to be filled ...

Quick Start

Requirements

  • docker
  • docker-compose
  • x64 or ARMv8 System
  • min 4 GB free Memory (depending on AI Model)

1. Clone this Repository:

git clone https://github.com/NopeNix/ai-counter.git

2. Run docker-compose

(The docker-compose.yml also works with Portainer)

docker compose up -d

ALTERNATIVE FOR DEV use docker compose watch:

docker compose watch

(this will automatically rebuild / sync files when there are changes)

3. Access Application

http://localhost:8079

Misc

Running the main.py file

python main.py --url image_url --model model_path

The model_path is optional. By default, it uses the https://tfhub.dev/google/openimages_v4/ssd/mobilenet_v2/1 model. You can also try the tensorflow/efficientdet/tensorFlow2/d0 model.

Extra optional arguments

  • --include-picture-with-boundingboxes : If you want to include the picture with the bounding boxes. This adds a image-base64-encoded key with a base64 encoded image encoded in utf-8.
  • --filter : If you want to filter the objects that are detected. For example, --filter "person,car" will only return the labels that are person or car (make sure to check out the labels supported by the models). Separate the labels with a comma, don't use spaces, and don't forget to wrap the labels with quotes.
  • --min-confidence : The minimum confidence for the model to consider the object detected.

ai-counter's People

Contributors

nopenix avatar amateuracademic avatar

Watchers

 avatar  avatar

ai-counter's Issues

Refactor the refactor branch for modular design, classes, etc.

Description

In the last issue #1, we cleaned up the code a bit and added some functionality. As a bonus, we also added another model. Given the fact that the code has gotten so complex and is easily broken, and the fact that we want to add more models in the future, we will need to refactor the code base.

We will want to:

  • Make classes for the modules
    • Class for both models
    • Class for image utils
  • Runner script that will import from the modules and run the detection
  • Document everything
  • Use docstrings
  • See if we can get some good type hinting working
  • Test everything

DoD

  • Module for image_utils
  • Module for ssd_mobilenet
  • Module for efficientdet
  • detect runner script
  • Tests passed for each module
  • Docstrings for each class and method
  • Bonus: type hinting

Add Additional Parameters to Python Script

right now the pyton script acceppts the following input parameters:

main.py file

python main.py --url image_url --model model_path

If possible i would like to be able to give the following additional input parameters:

python main.py --url image_url --model model_path --include-picture-with-boundingboxes --filter "car","person" --min-confidence 0,2

--include-picture-with-boundingboxes (Switch | Optional Parameter)

this parameter should add, to the existing json output:

{
  ...
  "image-base64-encoded": "IMAGE BASE64 ENCODED HERE"
}

--filter (List of Strings | Optional Parameter)

this parameter should filter the output, and what is displayed on the --include-picture-with-boundingboxes only the opjects specified should be displayed there can be multiple (e.g. "car","person")or just one or even none. the script should output everything what it detects when this parameter is not given

--confidence NUMBER (Integer | Optional Parameter)

this parameter should filter the output, and what is displayed on the --include-picture-with-boundingboxes only objects with a given minimum confidence level between 0 and 1 (also e.g. 0,3 and so on) should be outputted in the JSON and on the --include-picture-with-boundingboxes

pimping pythong script (adding input parameters)

Description

the python script, as of right now, accepts only one Input parameter: an url. This should be changed, a a few more Parameters are needed which are described in the DoD Section of the Issue

DoD

  • Script has an mandatory input Parameter "URL" which should use the current inpot argument
  • Script has an optional Parameter to Set Model (knowing that output of models are not standardized except for e.g. some from google)
  • Script has an mandatory input Parameter "Path" which should point to an image path instead of an URL
  • It should automatically be able to either use Path or URL up on which is specified. if none or two are specified then error
  • Short documentation how to use the new switches (can you do example pls? :) )

Info:

It would be nice if i could run the script with somehting like this when the changes are implemented:

 python script.py -URL https://noporn.com/garden.jpeg -MODEL GOOGLEMODELBLA

right now i am running it like that:

 python script.py https://noporn.com/garden.jpeg

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.