pose demo on android mobile based on PaddleDetection

Overview

pose_demo_android

pose demo on android mobile based on PaddleDetection

本工程Android部分基于Paddle-Lite-Demo修改。

算法模型基于PaddleDetectionPP-TinyPose.

如欲获取更多详情,请点击链接至相应repo中查看。

APP安装体验

下面部分为本工程使用介绍

要求

  • Android
    • Android Studio 4.2;
    • adb调试工具;
    • Android手机或开发版;

安装

$ git clone https://github.com/zhiboniu/pose_demo_android

  • Android
    • 打开Android Studio,在"Welcome to Android Studio"窗口点击"Open an existing Android Studio project",在弹出的路径选择窗口中进入"image_classification_demo"目录,然后点击右下角的"Open"按钮即可导入工程
    • 通过USB连接Android手机或开发板;
    • 载入工程后,点击菜单栏的Run->Run 'App'按钮,在弹出的"Select Deployment Target"窗口选择已经连接的Android设备(连接失败请检查本机adb工具是否正常),然后点击"OK"按钮;
    • 由于Demo所用到的库和模型均通过app/build.gradle脚本在线下载,因此,第一次编译耗时较长(取决于网络下载速度),请耐心等待;

更新到最新的预测库

Android更新预测库

  • 替换jar文件:将生成的build.lite.android.xxx.gcc/inference_lite_lib.android.xxx/java/jar/PaddlePredictor.jar替换demo中的Paddle-Lite-Demo/PaddleLite-android-demo/image_classification_demo/app/libs/PaddlePredictor.jar
  • 替换arm64-v8a jni库文件:将生成build.lite.android.armv8.gcc/inference_lite_lib.android.armv8/java/so/libpaddle_lite_jni.so库替换demo中的Paddle-Lite-Demo/PaddleLite-android-demo/image_classification_demo/app/src/main/jniLibs/arm64-v8a/libpaddle_lite_jni.so
  • 替换armeabi-v7a jni库文件:将生成的build.lite.android.armv7.gcc/inference_lite_lib.android.armv7/java/so/libpaddle_lite_jni.so库替换demo中的Paddle-Lite-Demo/PaddleLite-android-demo/image_classification_demo/app/src/main/jniLibs/armeabi-v7a/libpaddle_lite_jni.so.

代码结构介绍

主要源码位于工程pose_demo_android/app/src/main目录下,由三大部分组成java、cpp、assets。

  • java: Android前端界面相关代码部分
  • cpp: 算法实现相关代码
  • assets: 模型存放位置

pose_demo_android/app/src目录结构如下:

src/
|-- main
    |-- java                                        Java源码(Andoird前端部分)
    |   `-- com.baidu.paddle.lite.demo
    |       |-- common
    |       `-- yolo_detection
    |-- cpp                                         C++ 源码(底层算法部分)
    |   |-- CMakeLists.txt                          编译文件
    |   |-- Native.h                                Jni高级类型数据格式转换辅助函数
    |   |-- Native.cc                               Cpp与Java交互Jni接口
    |   |-- Pipeline.h
    |   |-- Pipeline.cc                             算法整体Pipeline流程
    |   |-- Detector.h
    |   |-- Detector.cc                             检测模型实现
    |   |-- Detector_Kpts.h
    |   |-- Detector_Kpts.cc                        关键点模型实现
    |   |-- postprocess.h
    |   |-- postprocess.cc                          关键点后处理所需函数
    |   |-- pose_action.h
    |   |-- pose_action.cc                          动作识别相关代码
    |   |-- Utils.h
    |   `-- Utils.cc                                模型前处理及其他函数
    `-- assets
        |-- images                                  未使用
        |-- models
        |   `-- yolov3_mobilenet_v3_for_cpu
        |       |--model_det.nb                     检测模型文件
        |       `--model_keypoint.nb                关键点模型文件
        `-- labels
            `-- coco_labels_2014_2017.txt           coco labels文件,实际只用了第一类person

许可证书

本项目的发布受Apache 2.0 license许可认证。

贡献代码

我们非常欢迎你可以为PaddleDetection提供代码,也十分感谢你的反馈。

  • 感谢Shigure19帮忙贡献Android前端代码。

引用

@misc{ppdet2021,
title={PaddleDetection, Object detection and instance segmentation toolkit based on PaddlePaddle.},
author={PaddlePaddle Authors},
howpublished = {\url{https://github.com/PaddlePaddle/PaddleDetection}},
year={2021}
}
You might also like...
Fast and robust certifiable relative pose estimation

Fast and Robust Relative Pose Estimation for Calibrated Cameras This repository contains the code for the relative pose estimation between two central

A project to control Petoi Bittle using human pose
A project to control Petoi Bittle using human pose

Petoi Bittle Controlled by Pose A project to control Petoi Bittle by human pose Human pose is estimated using MoveNet and TensorFlow Lite YouTube Syst

Python and C++ implementation of
Python and C++ implementation of "MarkerPose: Robust real-time planar target tracking for accurate stereo pose estimation". Accepted at LXCV Workshop @ CVPR 2021.

MarkerPose: Robust Real-time Planar Target Tracking for Accurate Stereo Pose Estimation This is a PyTorch and LibTorch implementation of MarkerPose: a

Distributed Pose Graph Optimization

Distributed Pose Graph Optimization

CUDA-accelerated Apriltag detection and pose estimation.
CUDA-accelerated Apriltag detection and pose estimation.

Isaac ROS Apriltag Overview This ROS2 node uses the NVIDIA GPU-accelerated AprilTags library to detect AprilTags in images and publishes their poses,

Real-Time Neural 3D Hand Pose Estimation from an Event Stream [ICCV 2021]

EventHands: Real-Time Neural 3D Hand Pose Estimation from an Event Stream Project Page Index TRAIN.md -- how to train the model from scratch EVAL_REAL

Reviatalizing Optimization for 3D Human Pose and Shape Estimation: A Sparse Constrained Formulation
Reviatalizing Optimization for 3D Human Pose and Shape Estimation: A Sparse Constrained Formulation

Reviatalizing Optimization for 3D Human Pose and Shape Estimation: A Sparse Constrained Formulation This is the implementation of the approach describ

Simple inference deep head pose ncnn version
Simple inference deep head pose ncnn version

ncnn-deep-head-pose Simple implement inference deep head pose ncnn version with high performance and optimized resource. This project based on deep-he

Blend between two non-concentric non-circular cones for use in a Pose Space system
Blend between two non-concentric non-circular cones for use in a Pose Space system

BlurRelax Why does maya not have a smooth or relax deformer? They've got brushes, sure, but no deformers. This one is pretty fast. I've got it working

Comments
  • tiny-pose安卓模型代码运行:Wrong broadcast type是什么错误?怎么解决?

    tiny-pose安卓模型代码运行:Wrong broadcast type是什么错误?怎么解决?

    A/Paddle-Lite: [F 11/ 1 18: 0:58.555 .../lite/kernels/host/elementwise_op_func.h:339 Update] Wrong broadcast type E/libc++abi: terminating with uncaught exception of type paddle::lite::PaddleLiteException: Paddle-Lite C++ Exception: [F 11/ 1 18: 0:58.555 .../lite/kernels/host/elementwise_op_func.h:339 Update] Wrong broadcast type A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 11084 (GLThread 218), pid 11035 (ction.detection)

    opened by LMR2018 1
Owner
null
Pose-tensorflow - Human Pose estimation with TensorFlow framework

Human Pose Estimation with TensorFlow Here you can find the implementation of the Human Body Pose Estimation algorithm, presented in the DeeperCut and

Eldar Insafutdinov 1.1k Dec 29, 2022
Mobile Robot Programming Toolkit (MRPT) provides C++ libraries aimed at researchers in mobile robotics and computer vision

The MRPT project 1. Introduction Mobile Robot Programming Toolkit (MRPT) provides C++ libraries aimed at researchers in mobile robotics and computer v

MRPT 1.6k Dec 24, 2022
Android hand detect and pose estimation by ncnn

ncnn_nanodet_hand 1.hand detect:用nanode-m训练了个hand detect模型, 2.hand pose:用CMU的数据集训练了个ghostnet作为backbone模仿pfld的handpose模型 3.推理:handpose.cpp单独检测pose,nano

null 80 Jan 3, 2023
Android MoveNet pose estimation by ncnn

ncnn_Android_MoveNet Android MoveNet single human pose estimation by ncnn this project is a ncnn Android demo for MoveNet, it depends on ncnn library

FeiGeChuanShu 93 Dec 31, 2022
RealSR-NCNN-Android is a simple Android application that based on Realsr-NCNN & Real-ESRGAN.

RealSR-NCNN-Android Real-ESRGAN is a Practical Algorithms for General Image Restoration. RealSR-NCNN-Android is a simple Android application that base

null 272 Jan 3, 2023
Android hair/human segmentation demo by ncnn

ncnn_Android_human Android hair/human segmentation demo by ncnn PS:performance maybe poor.it's just a demo:) Reference: 1.https://github.com/Tencent/n

null 23 May 23, 2022
Android demo of LightTrack infer by ncnn

ncnn_Android_LightTrack this project is a ncnn Android demo for LightTrack, it depends on ncnn library and opencv. https://github.com/Tencent/ncnn htt

FeiGeChuanShu 21 Dec 14, 2022
Android CrowdCounting demo infer by ncnn

ncnn_Android_CrowdCounting This is a sample CrowdCounting Android demo infer by ncnn, it depends on ncnn library and opencv https://github.com/Tencent

FeiGeChuanShu 10 Jul 2, 2022
ncnn Android demo of PP-TinyPose

ncnn_Android_PP-TinyPose ncnn Android demo of PP-TinyPose this project is a ncnn Android demo for PP-TinyPose, it depends on ncnn library and opencv.

FeiGeChuanShu 20 Nov 25, 2022
M-LSD Android demo infer by ncnn

ncnn_Android_mlsd The Android demo of M-LSD: Towards Light-weight and Real-time Line Segment Detection This is a sample ncnn android project, it depen

FeiGeChuanShu 17 Jun 22, 2022