rename packages

This commit is contained in:
Mautisim Munir 2022-11-10 03:44:57 +05:00
parent e857430326
commit 16a52fd95a
43 changed files with 88 additions and 88 deletions

View File

@ -30,7 +30,7 @@ android {
dependencies {
implementation project(':copperlabs-lindera')
implementation project(':copperlabs-computer-vision')
implementation project(':copperlabs-pose-api')
implementation project(':copperlabs-pose-detection')
implementation project(':copperlabs-pose-landmark')

View File

@ -22,7 +22,7 @@
android:theme="@style/Theme.Posetracking"
tools:targetApi="31">
<activity
android:name=".examples.posetracking_lindera.MainActivity"
android:name="ca.copperlabs.mediapipe.examples.posetracking_lindera.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View File

@ -1,20 +1,18 @@
package com.google.mediapipe.examples.posetracking_lindera;
package ca.copperlabs.mediapipe.examples.posetracking_lindera;
import static java.lang.Math.min;
import com.google.mediapipe.solutions.lindera.BodyJoints;
import com.google.mediapipe.solutions.lindera.ComputerVisionPlugin;
import com.google.mediapipe.solutions.lindera.XYZPointWithConfidence;
import ca.copperlabs.cv.BodyJoints;
import ca.copperlabs.cv.ComputerVisionPlugin;
import ca.copperlabs.cv.XYZPointWithConfidence;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Locale;
import java.util.Map;
public class ComputerVisionPluginImpl implements ComputerVisionPlugin {

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.mediapipe.examples.posetracking_lindera;
package ca.copperlabs.mediapipe.examples.posetracking_lindera;
import android.content.ContentResolver;
import android.content.ContentValues;
@ -33,9 +33,9 @@ import androidx.appcompat.app.AppCompatActivity;
import com.afollestad.materialdialogs.MaterialDialog;
import com.google.mediapipe.R;
import com.google.mediapipe.solutions.lindera.CameraRotation;
import com.google.mediapipe.solutions.lindera.InputSource;
import com.google.mediapipe.solutions.lindera.Lindera;
import ca.copperlabs.cv.CameraRotation;
import ca.copperlabs.cv.InputSource;
import ca.copperlabs.cv.ComputerVision;
import org.json.JSONException;
import org.json.JSONObject;
@ -56,7 +56,7 @@ import java.util.function.Consumer;
public class MainActivity extends AppCompatActivity {
private static final String TAG = "MainActivity";
private Lindera lindera;
private ComputerVision computerVision;
private ComputerVisionPluginImpl plugin;
private boolean isLinderaInitialized = false;
private boolean isDetectionStarted = false;
@ -78,13 +78,13 @@ public class MainActivity extends AppCompatActivity {
plugin = new ComputerVisionPluginImpl();
lindera = new Lindera(plugin);
lindera.setupVideoPicker(this);
List<String> cameras = lindera.getAvailableCameras();
computerVision = new ComputerVision(plugin);
computerVision.setupVideoPicker(this);
List<String> cameras = computerVision.getAvailableCameras();
// FRONT or BACK
lindera.setCamera("BACK");
lindera.setCameraRotation(CameraRotation.AUTOMATIC);
lindera.fpsHelper.onFpsUpdate = new Consumer<Double>() {
computerVision.setCamera("BACK");
computerVision.setCameraRotation(CameraRotation.AUTOMATIC);
computerVision.fpsHelper.onFpsUpdate = new Consumer<Double>() {
@Override
public void accept(Double fps) {
String text = "FPS: "+String.format("%04.1f" ,fps);
@ -102,9 +102,9 @@ public class MainActivity extends AppCompatActivity {
if (!isLinderaInitialized) {
modelLoadAsyncDialogue(()->{
if (inputSource==InputSource.VIDEO){
lindera.setInputSource(InputSource.VIDEO);
computerVision.setInputSource(InputSource.VIDEO);
}
lindera.initialize(findViewById(R.id.preview_display_layout), MainActivity.this);
computerVision.initialize(findViewById(R.id.preview_display_layout), MainActivity.this);
isLinderaInitialized = true;
findViewById(R.id.button_start_video).setVisibility(View.GONE);
findViewById(R.id.button_start_camera).setVisibility(View.GONE);
@ -115,7 +115,7 @@ public class MainActivity extends AppCompatActivity {
updateLandmarkButtonText();
updateModelComplexityButtonText();
if (inputSource==InputSource.VIDEO) {
lindera.pickVideo();
computerVision.pickVideo();
}
});
@ -153,7 +153,7 @@ public class MainActivity extends AppCompatActivity {
toggleLandmarks.setOnClickListener(
v ->{
this.lindera.setLandmarksVisibility(!this.lindera.getLandmarkVisibility());
this.computerVision.setLandmarksVisibility(!this.computerVision.getLandmarkVisibility());
updateLandmarkButtonText();
}
);
@ -213,7 +213,7 @@ public class MainActivity extends AppCompatActivity {
});
modelComplexity.setOnClickListener(v->{
int modelComplexityVal = lindera.getModelComplexity();
int modelComplexityVal = computerVision.getModelComplexity();
new MaterialDialog.Builder(this)
.title("Choose Model Complexity")
@ -227,8 +227,8 @@ public class MainActivity extends AppCompatActivity {
**/
if (which != modelComplexityVal){
modelLoadAsyncDialogue(()-> {
lindera.setModelComplexity(which);
lindera.restartDetection();
computerVision.setModelComplexity(which);
computerVision.restartDetection();
updateModelComplexityButtonText();
});
}
@ -247,7 +247,7 @@ public class MainActivity extends AppCompatActivity {
void updateLandmarkButtonText(){
Button toggleLandmarks = findViewById(R.id.button_toggle_landmarks);
if (this.lindera.getLandmarkVisibility()) {
if (this.computerVision.getLandmarkVisibility()) {
toggleLandmarks.setText("Show Landmarks (On)");
}else{
toggleLandmarks.setText("Show Landmarks (Off)");
@ -257,7 +257,7 @@ public class MainActivity extends AppCompatActivity {
void updateModelComplexityButtonText(){
String text = "Select Model ";
switch (this.lindera.getModelComplexity()){
switch (this.computerVision.getModelComplexity()){
case 0:
text += "(lite)";
break;

View File

@ -3,7 +3,7 @@ plugins {
}
android {
namespace 'com.google.mediapipe.solutions.lindera'
namespace 'ca.copperlabs.cv'
compileSdk 32
defaultConfig {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.mediapipe.solutions.posetracking">
package="ca.copperlabs.cv">
<uses-sdk android:minSdkVersion="21"
android:targetSdkVersion="27" />

View File

@ -1,4 +1,4 @@
package com.google.mediapipe.solutions.lindera;
package ca.copperlabs.cv;
import android.app.Activity;
import android.content.Intent;
@ -16,16 +16,16 @@ import com.google.mediapipe.formats.proto.LandmarkProto;
import com.google.mediapipe.solutioncore.CameraInput;
import com.google.mediapipe.solutioncore.SolutionGlSurfaceView;
import com.google.mediapipe.solutioncore.VideoInput;
import com.google.mediapipe.solutions.posetracking.PoseTracking;
import com.google.mediapipe.solutions.posetracking.PoseTrackingOptions;
import com.google.mediapipe.solutions.posetracking.PoseTrackingResult;
import com.google.mediapipe.solutions.posetracking.PoseTrackingResultGlRenderer;
import ca.copperlabs.mediapipe.posetracking.PoseTracking;
import ca.copperlabs.mediapipe.posetracking.PoseTrackingOptions;
import ca.copperlabs.mediapipe.posetracking.PoseTrackingResult;
import ca.copperlabs.mediapipe.posetracking.PoseTrackingResultGlRenderer;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class Lindera {
public class ComputerVision {
private ComputerVisionPlugin plugin;
public FpsHelper fpsHelper = new FpsHelper();
@ -43,7 +43,7 @@ public class Lindera {
private VideoInput videoInput;
private ActivityResultLauncher<Intent> videoGetter;
public Lindera(ComputerVisionPlugin plugin){
public ComputerVision(ComputerVisionPlugin plugin){
this.plugin = plugin;
}

View File

@ -1,4 +1,4 @@
package com.google.mediapipe.solutions.lindera;
package ca.copperlabs.cv;
public interface ComputerVisionPlugin {
void bodyJoints(Long timestamp, BodyJoints bodyJoints);

View File

@ -0,0 +1,5 @@
package ca.copperlabs.cv;
public enum InputSource {
VIDEO, CAMERA
}

View File

@ -1,5 +0,0 @@
package com.google.mediapipe.solutions.lindera;
public enum InputSource {
VIDEO, CAMERA
}

View File

@ -17,7 +17,7 @@ licenses(["notice"])
android_library(
name = "copperlabs-pose-api",
srcs = glob(["src/main/**/*.java"]),
custom_package = "com.google.mediapipe.solutions",
custom_package = "ca.copperlabs.mediapipe.posetracking",
javacopts = ["-Acom.google.auto.value.AutoBuilderIsUnstable"],
manifest = "src/main/AndroidManifest.xml",
visibility = ["//visibility:public"],

View File

@ -3,7 +3,7 @@ plugins {
}
android {
namespace 'com.google.mediapipe.solutions.posetracking'
namespace 'ca.copperlabs.mediapipe.posetracking'
compileSdk 32
defaultConfig {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.mediapipe.solutions">
package="ca.copperlabs.mediapipe.posetracking">
<uses-sdk android:minSdkVersion="24"
android:targetSdkVersion="27" />
</manifest>

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.mediapipe.solutions.posetracking;
package ca.copperlabs.mediapipe.posetracking;
import androidx.annotation.IntDef;

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.mediapipe.solutions.posetracking;
package ca.copperlabs.mediapipe.posetracking;
import android.content.Context;
import android.util.Log;

View File

@ -12,10 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.mediapipe.solutions.posetracking;
package ca.copperlabs.mediapipe.posetracking;
import com.google.auto.value.AutoValue;
import ca.copperlabs.mediapipe.posetracking.AutoValue_PoseTrackingOptions;
/**
* MediaPipe Face Detection solution-specific options.
*

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.mediapipe.solutions.posetracking;
package ca.copperlabs.mediapipe.posetracking;
import static java.lang.Math.min;
@ -31,6 +31,7 @@ import java.util.Arrays;
import java.util.List;
/**
* FaceDetectionResult contains the detected faces, and the input {@link Bitmap} or {@link
* TextureFrame}. If not in static image mode, the timestamp field will be set to the timestamp of

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.mediapipe.solutions.posetracking;
package ca.copperlabs.mediapipe.posetracking;
import android.opengl.GLES20;
@ -26,7 +26,6 @@ import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/** A custom implementation of {@link ResultGlRenderer} to render {@link PoseTrackingResult}. */

View File

@ -1,17 +0,0 @@
package com.google.mediapipe.solutions.posetracking;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

View File

@ -3,7 +3,7 @@ plugins {
}
android {
namespace 'com.google.copperlabs_pose_detection'
namespace 'ca.copperlabs.mediapipe.pose_detection'
compileSdk 32
defaultConfig {

View File

@ -0,0 +1,17 @@
package ca.copperlabs.copperlabs_pose_detection;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

View File

@ -3,7 +3,7 @@ plugins {
}
android {
namespace 'com.google.copperlabs_pose_graph'
namespace 'ca.copperlabs.mediapipe.pose_graph'
compileSdk 32
defaultConfig {

View File

@ -3,7 +3,7 @@ plugins {
}
android {
namespace 'com.google.copperlabs_pose_landmark'
namespace 'ca.copperlabs.mediapipe.pose_landmark'
compileSdk 32
defaultConfig {

View File

@ -15,7 +15,7 @@ dependencyResolutionManagement {
rootProject.name = "posetracking"
include ':app'
include ':copperlabs-pose-api'
include ':copperlabs-lindera'
include ':copperlabs-computer-vision'
include ':copperlabs-pose-landmark'
include ':copperlabs-pose-detection'
include ':copperlabs-pose-graph'