Giter Site home page Giter Site logo

changeyourdestiny / yolomobile Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wkt/yolomobile

0.0 0.0 0.0 94.42 MB

A Android Library for YOLOv5/YOLOv7/YOLOv8 Detection and Pose Inference Based on NCNN

License: Other

C++ 76.74% C 17.49% Java 2.85% CMake 2.92%

yolomobile's Introduction

A Android Library for YOLOv5/YOLOv7/YOLOv8 Detect/Pose Inference Based on NCNN

Support yolov5, edgeai-yolov5, yolov7, yolov8

System: Android 5.0+(21)

δΈ­ζ–‡

How to

1 download the .aar file

2 put .aar file in app/libs directory

3 edit app/build.gradle

implementation files('libs/yolo_mobile_release_2023xxyyzz_V1.0r1.aar')

4 put ncnn .bin and .param into assets directory

5 create new named 'yolo_cfg.json'

{
  "name": "yolov8n",
  "input_size": 384,
  "param": "yolov.param",
  "bin": "yolo.bin",
  "box_thr": 0.5,
  "iou_thr": 0.5,
  "nkpt": 0, 
  "ver": 8,
  "outputs": [
    {"name": "345","stride":8,"anchors": [10,13, 16,30, 33,23]},
    {"name": "365","stride":16,"anchors": [30,61, 62,45, 59,119]},
    {"name": "385","stride":32,"anchors": [116,90, 156,198, 373,326]}
  ],
  
  "names": [ "person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat", "traffic light",
  "fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse", "sheep", "cow",
  "elephant", "bear", "zebra", "giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee",
  "skis", "snowboard", "sports ball", "kite", "baseball bat", "baseball glove", "skateboard", "surfboard",
  "tennis racket", "bottle", "wine glass", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple",
  "sandwich", "orange", "broccoli", "carrot", "hot dog", "pizza", "donut", "cake", "chair", "couch",
  "potted plant", "bed", "dining table", "toilet", "tv", "laptop", "mouse", "remote", "keyboard", "cell phone",
  "microwave", "oven", "toaster", "sink", "refrigerator", "book", "clock", "vase", "scissors", "teddy bear",
  "hair drier", "toothbrush" ]

}

Key value:

input_size -- input image size (must be w=h), for example: 640

input_name -- input node name

outputs --- list of output node

Optional key value:

ver -- yolo v8 need set to 8

names -- class names

nkpt -- number of keypoint, for example(coco): 17

6 call the model


        infer = new YoloInfer(ctx);
        infer.loadFromConfigAssets("yolo_cfg.json");
        ...
        List<YoloInfer.Box> boxes = infer.detect(bitmap);
        ...
        YoloInfer.draw(canvas,boxes,paint);

Proguard

-keep class com.weiketing.yolomobile.YoloInfer { *; }

Demo

Download demo apk

Screenshot:

Rebuild .aar file

bash gradlew :YoloMobile:assembleRelease

yolomobile's People

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.