Giter VIP home page Giter VIP logo

tflite-object-detection-android-app-yolov5's Introduction

TFLite-Object-Detection-Android-App-YOLOv5

IMPORTANT !!!
First Reffer https://github.com/akhilkailas2001/Object-Detection-using-Yolov5.git
This is the continuation of Object Detection using Yolov5

Main Idea

  • Train yolov5 model
  • Convert yolov5 (.pt model) into a tensorflow model(.pb file)
  • Convert tensorflow model (.pb model) to tflite model.
  • Download and install Android Studio
  • Build and run your Object detection App.

Main Steps for Creating Android App

  • first open yolov5 folder in command prompt then type "python export.py --data your_yaml_file.yaml --weights runs/train/exp/weights/best.pt --include tflite --img 640" for exporting the weight to tensorflow lite.
  • it will create a .tflite file in yolov5/runs/train/exp/weights this location.
  • test our exported data by typing "python detect.py --weights runs/train/exp/weights/best-fp16.tflite --img 640 --source data/images/"
  • copy android folder to yolov5 folder.
  • goto location android\app\src\main\assets and paste the best-fp16.tflite file created during exporting in yolov5.
  • goto location android\app\src\main\assets and edit customclasses.txt file by adding our class name in order.type only one class name in one line.
  • goto location android\app\src\main\java\org\tensorflow\lite\examples\detection\tflite then edit DetectorFactory.java file by comparing with the DetectorFactory.java that i given then save the file.
  • download and install android studio then run the program.

Yolo Commands

  • python train.py --img 415 --batch 16 --epochs 30 --data dataset.yaml --weights yolov5s.pt --cache
  • python train.py --img 640 --batch 8 --epochs 100 --data mat.yaml --weights yolov5s.pt --cache
  • python detect.py --source data/images/ --weights runs/train/exp/weights/best.pt
  • python detect.py --source data/images/ --weights runs/train/exp/weights/best.pt --conf 0.50
  • python export.py --data mat.yaml --weights runs/train/exp/weights/best.pt --include tflite --img 640
  • python detect.py --weights runs/train/exp/weights/best-fp16.tflite --img 640 --source data/images/

References

tflite-object-detection-android-app-yolov5's People

Contributors

akhilkailas017 avatar

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.