diff --git a/README.md b/README.md index ec4d16f..aa5bcb5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ # JDClone -Ovo's attempt at something beautiful, pls do not touch for now, tnxx \ No newline at end of file +react + vite +scss +typescript + +connect to local server 127.0.0.1 +python +runs AI inference \ No newline at end of file diff --git a/example_client.html b/example_client.html new file mode 100644 index 0000000..722214d --- /dev/null +++ b/example_client.html @@ -0,0 +1,364 @@ + + +
+ + +Waiting for data...+
Loading game data...
+{error}
+Get ready to dance!
+{currentScore.toLocaleString()}
+{combo}x
+x{multiplier}
+Dance video will play here
+Song: {song?.title} by {song?.artist}
+Move indicators will appear here
+Difficulty: {difficulty}
+{selectedSong?.artist || 'Unknown Artist'}
+{currentScore}
+ +{Math.round(accuracy * 100)}%
+Camera not connected
+ +{song.artist}
+{Math.floor(song.duration / 60)}:{(song.duration % 60).toString().padStart(2, '0')}
+Camera connection required to play. Please check your camera permissions.
+ )} +Waiting for data...+ + + + + + """ + +@app.route('/video_feed') +def video_feed(): + """Route to serve the raw video feed""" + return Response(generate_frames(get_annotated=False), + mimetype='multipart/x-mixed-replace; boundary=frame') + +@app.route('/video_feed/annotated') +def video_feed_annotated(): + """Route to serve the annotated video feed""" + return Response(generate_frames(get_annotated=True), + mimetype='multipart/x-mixed-replace; boundary=frame') + +@app.route('/landmarks') +def get_landmarks(): + """Route to get the latest landmarks data""" + if latest_landmarks_data: + return Response(json.dumps(latest_landmarks_data), + mimetype='application/json') + else: + return Response(json.dumps({"error": "No landmarks data available yet"}), + mimetype='application/json') + +def main(): + # Start the pose detection thread + detection_thread = threading.Thread(target=pose_detection_thread) + detection_thread.daemon = True + detection_thread.start() + + # Start the Flask app with SocketIO + print("Starting API server at http://127.0.0.1:5000") + socketio.run(app, host='0.0.0.0', port=5000, debug=False, allow_unsafe_werkzeug=True) + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + print("Shutting down...") + processing_active = False \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e125beb --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +opencv-python>=4.5.0 +mediapipe>=0.8.9 +flask>=2.0.0 +flask-socketio>=5.1.0 +flask-cors>=3.0.10 +numpy>=1.19.0 \ No newline at end of file