Code Monkey home page Code Monkey logo

posetracker-android-prototype's Introduction

PoseTracker-Android-Prototype

PoseTracker Android Demo Prototype, which is based on mmdeploy

Before start, you need a personal computer with linux system and an android mobile phone with Android version >= 11.0.

QuickStart

Here is app-release.apk in PoseTracker-Android-Prototype/app/release folder.

Copy this file and install to the mobile phone, then you can enjoy it.

Usage

step 0. Git clone this repo.

git clone https://github.com/hanrui1sensetime/PoseTracker-Android-Prototype.git
export POSETRACKER_DEMO_ROOT=${PWD}

step 1. Download OpenCV-android sdk and set as Java module.

wget https://github.com/opencv/opencv/releases/download/4.7.0/opencv-4.7.0-android-sdk.zip
unzip opencv-4.7.0-android-sdk.zip
cd PoseTracker-Android-Prototype/
ln -s ../OpenCV-android-sdk/sdk/ openCVLibrary470

Because of this repo uses Java rather than Kotlin, so please comment the line

// apply plugin: 'kotlin-android'

in OpenCV-android-sdk/sdk/build.gradle.

step 2. Cross compile MMDeploy SDK.

cd ${POSETRACKER_DEMO_ROOT}
git clone -b dev-1.x https://github.com/open-mmlab/mmdeploy.git
cd mmdeploy
git submodule update --init
mkdir -p build && cd build

Then you can follow this doc to build mmdeploy sdk.

step 3. Prepare jniLibs.

jniLibs requires libopencv_java4.so, libmmdeploy_java.so and libc++_shared.so.

cd ${POSETRACKER_DEMO_ROOT}
mkdir -p PoseTracker-Android-Prototype/app/src/main/jniLibs/arm64-v8a
cp OpenCV-android-sdk/sdk/native/libs/arm64-v8a/libopencv_java4.so PoseTracker-Android-Prototype/app/src/main/jniLibs/arm64-v8a/
cp mmdeploy/build/lib/libmmdeploy_java.so PoseTracker-Android-Prototype/app/src/main/jniLibs/arm64-v8a/
cp ${NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so PoseTracker-Android-Prototype/app/src/main/jniLibs/arm64-v8a/

In the bash code above, the ${NDK_PATH} can be found in the build mmdeploy android doc.

step 4. Open Android Studio and build the Android demo.

Link the mobile phone to PC, open Android Studio. Then click Build->Make Project and Run->Run app.

How to Develop Android App by MMDeploy Java API

TODO.

posetracker-android-prototype's People

Contributors

hanrui1sensetime avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

posetracker-android-prototype's Issues

在android studio build project 时发生错误

您好,我想请问一下,我按照您的步骤对mmdeploy进行交叉编译后,在android studio执行build发生这个错误,是因为使用不同java版本编译的关系吗

A problem occurred configuring root project 'PoseTracker'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:7.4.2.
     Required by:
         project :
      > No matching variant of com.android.tools.build:gradle:7.4.2 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.4' but:
          - Variant 'apiElements' capability com.android.tools.build:gradle:7.4.2 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.4')
          - Variant 'javadocElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.4')
          - Variant 'runtimeElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.4')
          - Variant 'sourcesElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.4')

以下是我的版本:

(base) david@david-System-Product-Name:~/android-studio/bin$ sudo update-alternatives --config javac
[sudo] password for david: 
There is only one alternative in link group javac (providing /usr/bin/javac): /home/david/jdk-18/bin/javac
Nothing to configure.
(base) david@david-System-Product-Name:~/android-studio/bin$ sudo update-alternatives --config java
There is only one alternative in link group java (providing /usr/bin/java): /home/david/jdk-18
Nothing to configure.

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.