Skip to content

update#1

Open
Stefanos0710 wants to merge 149 commits into
Stefanos0710:mainfrom
niiccoo2:main
Open

update#1
Stefanos0710 wants to merge 149 commits into
Stefanos0710:mainfrom
niiccoo2:main

Conversation

@Stefanos0710

Copy link
Copy Markdown
Owner

No description provided.

Stefanos0710 and others added 30 commits December 13, 2025 13:29
Copilot AI review requested due to automatic review settings December 17, 2025 16:40
@vercel

vercel Bot commented Dec 17, 2025

Copy link
Copy Markdown

@niiccoo2 is attempting to deploy a commit to the codeprotech's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Stefanos0710 Stefanos0710 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR represents a major architectural restructuring that transitions the project from a Python Flask backend with vanilla JavaScript frontend to a SvelteKit-based application with Socket.IO for real-time communication. The changes introduce pose detection capabilities using MediaPipe alongside the existing hand tracking functionality, creating a more comprehensive body tracking game experience.

Key Changes:

  • Migration to SvelteKit framework with complete project reorganization into svelte/ directory
  • Addition of body pose detection using MediaPipe Pose alongside existing hand tracking
  • Implementation of Socket.IO server for real-time communication between camera clients and game instances
  • Introduction of deployment configurations (Vercel, Docker) and custom Node.js server

Reviewed changes

Copilot reviewed 28 out of 98 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
vercel.json Added Vercel deployment config (contains incorrect Python configuration)
vite.config.ts Deleted root Vite config (moved to svelte/ directory)
tf/recognision.py Enhanced with pose detection, body keypoint extraction, and restructured output format
tf/live_recognision.py Added MediaPipe Pose initialization
templates/*.html Added new HTML templates for camera connection and streaming
svelte/ Complete new SvelteKit application structure with game logic, Socket.IO integration, and multi-camera support
svelte/server.js Custom Express server with Socket.IO for handling camera sessions and real-time data relay
svelte/package.json Project dependencies including MediaPipe, Socket.IO, and SvelteKit adapters
Comments suppressed due to low confidence (1)

tf/live_recognision.py:113

  • The comment "# hand reco stuff" is too informal and vague. Consider using a more descriptive comment like "# Process hand recognition landmarks" to better explain the purpose of this code block.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread vercel.json
Comment on lines +4 to +5
"src": "main.py",
"use": "@vercel/python"

Copilot AI Dec 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vercel.json configuration specifies Python deployment with "@vercel/python" and references "main.py", but this repository contains TypeScript/JavaScript/SvelteKit code. This configuration appears incorrect for the actual project structure. The deployment should use a Node.js adapter instead.

Copilot uses AI. Check for mistakes.
Comment thread tf/recognision.py

# ----- MediaPipe Hands -----
mp_hands = mp.solutions.hands
mp_hands = mp.solutions.hands #type:ignore

Copilot AI Dec 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type ignore comment is added inline which is less clean. Consider placing the type ignore comment on a separate line above for better readability, or better yet, configure the type checker to properly recognize the mediapipe module.

Copilot uses AI. Check for mistakes.
Comment thread tf/recognision.py
Comment on lines +25 to +54
def get_body_keypoints(pose_landmarks):
if not pose_landmarks:
return None

lm = pose_landmarks.landmark

keypoints = {
"head": {
"x": lm[mp_pose.PoseLandmark.NOSE].x,
"y": lm[mp_pose.PoseLandmark.NOSE].y
},
"left_shoulder": {
"x": lm[mp_pose.PoseLandmark.LEFT_SHOULDER].x,
"y": lm[mp_pose.PoseLandmark.LEFT_SHOULDER].y
},
"right_shoulder": {
"x": lm[mp_pose.PoseLandmark.RIGHT_SHOULDER].x,
"y": lm[mp_pose.PoseLandmark.RIGHT_SHOULDER].y
},
"left_elbow": {
"x": lm[mp_pose.PoseLandmark.LEFT_ELBOW].x,
"y": lm[mp_pose.PoseLandmark.LEFT_ELBOW].y
},
"right_elbow": {
"x": lm[mp_pose.PoseLandmark.RIGHT_ELBOW].x,
"y": lm[mp_pose.PoseLandmark.RIGHT_ELBOW].y
}
}

return keypoints

Copilot AI Dec 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newly added function get_body_keypoints lacks a docstring. It should include documentation describing its parameters, return value, and purpose, especially since it's extracting specific pose landmarks from MediaPipe results.

Copilot uses AI. Check for mistakes.
Comment thread tf/recognision.py

def main(frame):
frame = cv2.flip(frame, 1)
# frame = cv2.flip(frame, 1)

Copilot AI Dec 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commented-out frame flip code should either be removed if no longer needed or accompanied by a comment explaining why it's kept but disabled. Leaving commented code without explanation reduces maintainability.

Copilot uses AI. Check for mistakes.
Comment thread svelte/server.js
});

socket.on('frame', ({ cameraId, blob }) => {
for (const [session_id, session] of sessions.entries()) {

Copilot AI Dec 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable session_id.

Copilot uses AI. Check for mistakes.
Comment thread main.py
import qrcode as qr
import os as os
import time
from threading import Lock

Copilot AI Dec 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'Lock' is not used.

Suggested change
from threading import Lock

Copilot uses AI. Check for mistakes.
Comment thread main.py
try:
q.get_nowait() # Drop oldest frame
q.put_nowait((blob, int(time.time() * 1000)))
except:

Copilot AI Dec 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except block directly handles BaseException.

Suggested change
except:
except (queue.Empty, queue.Full):

Copilot uses AI. Check for mistakes.
Comment thread main.py
processed_any = True

socketio.sleep(0)
except queue.Empty:

Copilot AI Dec 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
except queue.Empty:
except queue.Empty:
# No frame is currently queued for this session; skip to the next one.

Copilot uses AI. Check for mistakes.
Comment thread main.py
try:
q.get_nowait() # Drop oldest frame
q.put_nowait((blob, int(time.time() * 1000)))
except:

Copilot AI Dec 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'except' clause does nothing but pass and there is no explanatory comment.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants