Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,122 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
title: AI Vision Application - Cross-platform, Offline
|
| 4 |
+
description: An open-source cross-platform AI Vision application built on onnxruntime, numpy & opencv. It can perform tasks like object detection, image classification on your image. It also uses a model like Google SpeciesNet (cameratrapai) to identify wildlife species.
|
| 5 |
+
meta:
|
| 6 |
+
- name: keywords
|
| 7 |
+
content: ai vision, object detection, speciesnet google, google cameratrapai, speciesnet onnxruntime model, onnxruntime, opencv, numpy, offline ai, cross-platform ai app, onnxruntime android, python on android
|
| 8 |
+
- name: author
|
| 9 |
+
content: Somnath Das
|
| 10 |
+
- name: robots
|
| 11 |
+
content: index, follow
|
| 12 |
+
- property: og:image
|
| 13 |
+
content: https://blog.daslearning.in/llm_ai/ml/images/ogImg.png
|
| 14 |
+
- property: og:title
|
| 15 |
+
content: AI Vision Application - Cross-platform, Offline
|
| 16 |
+
- property: og:description
|
| 17 |
+
content: An open-source cross-platform AI Vision application built on onnxruntime, numpy & opencv. It can perform tasks like object detection, image classification on your image. It also uses a model like Google SpeciesNet (cameratrapai) to identify wildlife species.
|
| 18 |
+
- property: og:url
|
| 19 |
+
content: https://blog.daslearning.in/llm_ai/ml/ai-vision.html
|
| 20 |
+
- name: canonical
|
| 21 |
+
content: https://blog.daslearning.in/llm_ai/ml/ai-vision.html
|
| 22 |
+
- property: og:type
|
| 23 |
+
content: article
|
| 24 |
+
- property: article:author
|
| 25 |
+
content: https://daslearning.in/contact/
|
| 26 |
+
- property: og:site_name
|
| 27 |
+
content: DasLearning
|
| 28 |
+
- name: theme-color
|
| 29 |
+
content: "#0f172a" # dark blue-grey for Chrome mobile UI
|
| 30 |
+
- name: viewport
|
| 31 |
+
content: width=device-width, initial-scale=1.0
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
# 👁️ AI Vision
|
| 35 |
+
Using small machine learning or AI models we will be performing various `Computer Vision` related operations, for example `Object Detection` on images. This project purely focused on cross-platform applications & we can run small AI/ML models on our mobile phones in offline mode.
|
| 36 |
+
|
| 37 |
+
> This project is buid on `kivy`, `kivymd` and uses `onnxruntime`, `numpy`, `opencv` etc. to perform the tasks. This is still at very early phase before this project matures at some level.
|
| 38 |
+
|
| 39 |
+
<a href="https://github.com/daslearning-org/vision-ai/releases" target="_blank" rel="noopener noreferrer"><img alt="GitHub Downloads (all assets, all releases)" src="https://img.shields.io/github/downloads/daslearning-org/vision-ai/total"></a>
|
| 40 |
+
<a href="https://www.youtube.com/watch?v=wUABgn4JYc4" target="_blank" rel="noopener noreferrer"><img alt="GitHub Downloads (all assets, all releases)" src="https://img.shields.io/youtube/views/wUABgn4JYc4"></a>
|
| 41 |
+
|
| 42 |
+
### Features
|
| 43 |
+
1. Objects detection from `Image` in local storage. It uses [SSD-MobilenetV1](https://github.com/onnx/models/tree/main/validated/vision/object_detection_segmentation/ssd-mobilenetv1)
|
| 44 |
+
2. Directly capture from `Camera` & detect objects on the image. It also uses the same model as above.
|
| 45 |
+
3. `Image Prediction`: if you have an image of a single object & want to get top-5 predictions about the image, just upload & click `Classify`. It uses [ResNet18](https://github.com/onnx/models/tree/main/validated/vision/classification/resnet) which has around `1000` categories.
|
| 46 |
+
4. `Identify Species` from a photo. It uses [Google SpeciesNet](https://github.com/google/cameratrapai) & it has around `2000` odd species.
|
| 47 |
+
5. `No Ads`, completely `open-source` (free).
|
| 48 |
+
6. No `trackers`, no `data collection` etc. Actually you own your data & your app.
|
| 49 |
+
|
| 50 |
+
## 📽️ Demo
|
| 51 |
+
You can play below Video or click this [Youtube Link](https://www.youtube.com/watch?v=wUABgn4JYc4) to see the demo. Please let me know in the comments, how do you feel about this App. <br>
|
| 52 |
+
|
| 53 |
+
<iframe width="560" height="315" src="https://www.youtube.com/embed/wUABgn4JYc4" title="YouTube video player" frameborder="0" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
|
| 54 |
+
|
| 55 |
+
## 🖧 Our Scematic Architecture
|
| 56 |
+
To be added...
|
| 57 |
+
|
| 58 |
+
## 🧑💻 Quickstart Guide
|
| 59 |
+
|
| 60 |
+
### 📱 Download & Run the Android App
|
| 61 |
+
You can check the [Releases](https://github.com/daslearning-org/vision-ai/releases) and downlaod the latest version of the android app on your phone.
|
| 62 |
+
|
| 63 |
+
1. If you want to select an image from phone memory, do it either from `DCIM` or `Downloads` or `Pictures` or any subfolders of this three folders. Same goes while saving the output image too.
|
| 64 |
+
|
| 65 |
+
2. If you use the camera detection, please note that it uses back camera in `Landscape` mode only, so you may need to rotate your phone to capture it properly.
|
| 66 |
+
|
| 67 |
+
#### Requirements
|
| 68 |
+
- Minimum `Android 9`
|
| 69 |
+
|
| 70 |
+
### 💻 Download & Run the Windows or Linux App
|
| 71 |
+
To be built later. For now you may use with python directly as mentioned below.
|
| 72 |
+
|
| 73 |
+
### 🐍 Run with Python
|
| 74 |
+
|
| 75 |
+
1. Clone the repo
|
| 76 |
+
```bash
|
| 77 |
+
git clone https://github.com/daslearning-org/vision-ai.git
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
2. Run the application
|
| 81 |
+
```bash
|
| 82 |
+
cd vision-ai/onnx/
|
| 83 |
+
pip install -r requirements.txt # virtual environment is recommended
|
| 84 |
+
python main.py
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
### 📥 More open-source apps from us
|
| 88 |
+
You may check our other apps from our [app list](https://daslearning.in/apps/)
|
| 89 |
+
|
| 90 |
+
## 🦾 Build your own App
|
| 91 |
+
The Kivy project has a great tool named [Buildozer](https://buildozer.readthedocs.io/en/latest/) which can make mobile apps for `Android` & `iOS`
|
| 92 |
+
|
| 93 |
+
### 📱 Build Android App
|
| 94 |
+
A Linux environment is recommended for the app development. If you are on Windows, you may use `WSL` or any `Virtual Machine`. As of now the `buildozer` tool works on Python version `3.11` at maximum. I am going to use Python `3.11`
|
| 95 |
+
|
| 96 |
+
```bash
|
| 97 |
+
# add the python repository
|
| 98 |
+
sudo add-apt-repository ppa:deadsnakes/ppa
|
| 99 |
+
sudo apt update
|
| 100 |
+
|
| 101 |
+
# install all dependencies.
|
| 102 |
+
sudo apt install -y ant autoconf automake ccache cmake g++ gcc libbz2-dev libffi-dev libltdl-dev libtool libssl-dev lbzip2 make ninja-build openjdk-17-jdk patch patchelf pkg-config protobuf-compiler python3.11 python3.11-venv python3.11-dev
|
| 103 |
+
|
| 104 |
+
# optionally we can default to python 3.11
|
| 105 |
+
sudo ln -sf /usr/bin/python3.11 /usr/bin/python3
|
| 106 |
+
sudo ln -sf /usr/bin/python3.11 /usr/bin/python
|
| 107 |
+
sudo ln -sf /usr/bin/python3.11-config /usr/bin/python3-config
|
| 108 |
+
|
| 109 |
+
# optionally you may check the java installation with below commands
|
| 110 |
+
java -version
|
| 111 |
+
javac -version
|
| 112 |
+
|
| 113 |
+
# install python modules
|
| 114 |
+
git clone https://github.com/daslearning-org/vision-ai.git
|
| 115 |
+
cd vision-ai/onnx/
|
| 116 |
+
python3.11 -m venv .env # create python virtual environment
|
| 117 |
+
source .env/bin/activate
|
| 118 |
+
pip install -r req_android.txt
|
| 119 |
+
|
| 120 |
+
# build the android apk
|
| 121 |
+
buildozer android debug # this may take a good amount of time for the first time & will generate the apk in the bin directory
|
| 122 |
+
```
|