-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_setup.sh
More file actions
130 lines (113 loc) · 5.35 KB
/
Copy pathcheck_setup.sh
File metadata and controls
130 lines (113 loc) · 5.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/bash
# Setup verification script for Live2D Face Pipeline
echo "=================================="
echo "Live2D Face Pipeline Setup Checker"
echo "=================================="
echo ""
# Color codes
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Check function
check_file() {
if [ -f "$1" ]; then
echo -e "${GREEN}✓${NC} $2"
return 0
else
echo -e "${RED}✗${NC} $2 (NOT FOUND: $1)"
return 1
fi
}
check_dir() {
if [ -d "$1" ]; then
echo -e "${GREEN}✓${NC} $2"
return 0
else
echo -e "${RED}✗${NC} $2 (NOT FOUND: $1)"
return 1
fi
}
ERRORS=0
echo "1. Checking MediapipeFaceLandmark module..."
check_file "$PROJECT_ROOT/MediapipeFaceLandmark/src/main/assets/face_detector_mp.mnn" "Face detector model" || ((ERRORS++))
check_file "$PROJECT_ROOT/MediapipeFaceLandmark/src/main/assets/face_landmark_detector_mp.mnn" "Face landmarker model" || ((ERRORS++))
check_file "$PROJECT_ROOT/MediapipeFaceLandmark/src/main/cpp/mediapipefacelandmark.cpp" "JNI bridge implementation" || ((ERRORS++))
check_file "$PROJECT_ROOT/MediapipeFaceLandmark/src/main/cpp/simple_mediapipe_face.cpp" "MediaPipe face detector" || ((ERRORS++))
check_file "$PROJECT_ROOT/MediapipeFaceLandmark/src/main/java/com/example/mediapipefacelandmark/Camera2Manager.kt" "Camera2 manager" || ((ERRORS++))
check_file "$PROJECT_ROOT/MediapipeFaceLandmark/src/main/java/com/example/mediapipefacelandmark/MediaPipeFaceDetector.kt" "MediaPipe face detector wrapper" || ((ERRORS++))
echo ""
echo "2. Checking OpenSeeFaceProcess module..."
check_file "$PROJECT_ROOT/OpenSeeFaceProcess/src/main/java/com/live2d/facecapture/FaceCapturePipeline.kt" "Face capture pipeline" || ((ERRORS++))
check_file "$PROJECT_ROOT/OpenSeeFaceProcess/src/main/java/com/live2d/facecapture/BlendShapeExtractor.kt" "BlendShape extractor" || ((ERRORS++))
check_file "$PROJECT_ROOT/OpenSeeFaceProcess/src/main/java/com/live2d/facecapture/Landmark.kt" "Landmark definitions" || ((ERRORS++))
echo ""
echo "3. Checking Live2D module..."
check_dir "$PROJECT_ROOT/Live2D/src/main/assets/Live2DModels" "Live2D models directory" || ((ERRORS++))
check_file "$PROJECT_ROOT/Live2D/src/main/java/com/live2d/demo/JniBridgeJava.java" "Live2D JNI bridge" || ((ERRORS++))
check_file "$PROJECT_ROOT/Live2D/src/main/java/com/live2d/demo/GLRenderer.java" "Live2D GL renderer" || ((ERRORS++))
# Count Live2D models
MODEL_COUNT=$(ls -d "$PROJECT_ROOT/Live2D/src/main/assets/Live2DModels"/*/ 2>/dev/null | wc -l | tr -d ' ')
if [ "$MODEL_COUNT" -gt 0 ]; then
echo -e "${GREEN}✓${NC} Found $MODEL_COUNT Live2D model(s)"
ls -d "$PROJECT_ROOT/Live2D/src/main/assets/Live2DModels"/*/ 2>/dev/null | while read model; do
echo " - $(basename "$model")"
done
else
echo -e "${RED}✗${NC} No Live2D models found"
((ERRORS++))
fi
echo ""
echo "4. Checking App module..."
check_file "$PROJECT_ROOT/app/src/main/java/com/example/live2dfacepipeline/MainActivity.kt" "Main activity" || ((ERRORS++))
check_file "$PROJECT_ROOT/app/src/main/java/com/example/live2dfacepipeline/FaceTracker.kt" "Face tracker" || ((ERRORS++))
check_file "$PROJECT_ROOT/app/src/main/java/com/example/live2dfacepipeline/Live2DView.kt" "Live2D view" || ((ERRORS++))
check_file "$PROJECT_ROOT/app/src/main/AndroidManifest.xml" "App manifest" || ((ERRORS++))
# Check camera permission in manifest
if grep -q "android.permission.CAMERA" "$PROJECT_ROOT/app/src/main/AndroidManifest.xml" 2>/dev/null; then
echo -e "${GREEN}✓${NC} Camera permission declared in manifest"
else
echo -e "${RED}✗${NC} Camera permission NOT found in manifest"
((ERRORS++))
fi
echo ""
echo "5. Checking build configuration..."
check_file "$PROJECT_ROOT/app/build.gradle" "App build.gradle" || ((ERRORS++))
check_file "$PROJECT_ROOT/MediapipeFaceLandmark/build.gradle" "MediapipeFaceLandmark build.gradle" || ((ERRORS++))
check_file "$PROJECT_ROOT/MediapipeFaceLandmark/src/main/cpp/CMakeLists.txt" "CMakeLists.txt" || ((ERRORS++))
# Check module dependencies in app/build.gradle
if grep -q "project(':MediapipeFaceLandmark')" "$PROJECT_ROOT/app/build.gradle" 2>/dev/null; then
echo -e "${GREEN}✓${NC} MediapipeFaceLandmark dependency in app"
else
echo -e "${YELLOW}⚠${NC} MediapipeFaceLandmark dependency may be missing"
fi
if grep -q "project(':OpenSeeFaceProcess')" "$PROJECT_ROOT/app/build.gradle" 2>/dev/null; then
echo -e "${GREEN}✓${NC} OpenSeeFaceProcess dependency in app"
else
echo -e "${YELLOW}⚠${NC} OpenSeeFaceProcess dependency may be missing"
fi
if grep -q "project(':Live2D')" "$PROJECT_ROOT/app/build.gradle" 2>/dev/null; then
echo -e "${GREEN}✓${NC} Live2D dependency in app"
else
echo -e "${YELLOW}⚠${NC} Live2D dependency may be missing"
fi
echo ""
echo "=================================="
if [ $ERRORS -eq 0 ]; then
echo -e "${GREEN}✓ All checks passed!${NC}"
echo "Project is ready to build."
else
echo -e "${RED}✗ Found $ERRORS error(s)${NC}"
echo "Please fix the issues above before building."
exit 1
fi
echo "=================================="
echo ""
echo "Next steps:"
echo " 1. Open project in Android Studio"
echo " 2. Sync Gradle"
echo " 3. Build project: ./gradlew build"
echo " 4. Run on device with camera"
echo ""
echo "For more information, see IMPLEMENTATION_GUIDE.md"