Spaces:
Build error
Build error
Commit History
-
Create index.js
Verified signatureff394a4 -
Create yarn.lock
Verified signaturef44f751 -
Create vite.config.js
Verified signature3d27550 -
Create package.json
Verified signatured6e4ffb -
Create package-lock.json
Verified signaturefa66939 -
Create nginx.conf
Verified signatureae89f36 -
Create index.html
Verified signaturea77ebb2 -
Create eslint.config.js
Verified signature05f9b18 -
Update README.md
Verified signature084956d -
Update README.md
Verified signaturef4f5667 -
Create Dockerfile
Verified signature37122d8 -
Create .gitignore
Verified signaturea0e80ec -
Update .gitattributes
Verified signatureeada46c -
Delete requirements.txt
Verified signature0ae033a -
Delete app.py
Verified signature15d28f0 -
Update requirements.txt
Verified signatured501a5f -
Update requirements.txt
Verified signature9d81c60 -
Update requirements.txt
Verified signaturecfa9537 -
import gradio as gr import cv2 import mediapipe as mp mp_hands = mp.solutions.hands hands = mp_hands.Hands(static_image_mode=False, max_num_hands=2, min_detection_confidence=0.5, min_tracking_confidence=0.5) # AI feedback logic based on hand positions def surgical_feedback_webcam(video_path): cap = cv2.VideoCapture(video_path) feedback_messages = [] while cap.isOpened(): ret, frame = cap.read() if not ret: break frame_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) result = hands.process(frame_rgb) if result.multi_hand_landmarks: for hand_landmarks in result.multi_hand_landmarks: wrist_y = hand_landmarks.landmark[mp_hands.HandLandmark.WRIST].y if wrist_y < 0.3: feedback_messages.append("Gabanya height y'igikoresho.") else: feedback_messages.append("Position y'amaboko ni nziza.") cap.release() return "\n".join(feedback_messages[-5:]) # last 5 feedbacks with gr.Blocks() as demo: gr.Markdown("# Full Interactive 3D Surgical Training AI") gr.Markdown("Reba 3D mannequin, ukoreshe webcam cyangwa wandike surgical action, AI izaguha feedback ako kanya.") with gr.Row(): # Left: 3D mannequin gr.HTML( """ <model-viewer src="assets/mannequin.glb" alt="3D Mannequin" auto-rotate camera-controls style="width: 400px; height: 400px;"> </model-viewer> """ ) # Right: User input + feedback with gr.Column(): user_input = gr.Textbox(label="Describe your surgical action") video_input = gr.Video(label="Or upload hand movement video") feedback = gr.Textbox(label="AI Feedback") # Text input feedback user_input.submit(lambda x: "Byiza! Komeza gutya." if x=="" else "AI Feedback: "+x, user_input, feedback) # Video input feedback video_input.upload(surgical_feedback_webcam, video_input, feedback) demo.launch()
Verified signaturea66209f -
import gradio as gr # Simple AI feedback def surgical_feedback(action_description): action = action_description.lower() if "scalpel too high" in action: return "Gabanya umuvuduko w'igikoresho." elif "cut too deep" in action: return "Gabanya depth y'igikata." elif "incorrect angle" in action: return "Hindura angle y'igikoresho." else: return "Byiza! Komeza gutya." with gr.Blocks() as demo: gr.Markdown("# 3D Surgical Training AI Prototype") gr.Markdown( "Reba mannequin hasi, wandike uko wakoze igikorwa, AI izaguha feedback." ) with gr.Row(): # 3D mannequin gr.HTML( """ <model-viewer src="assets/mannequin.glb" alt="3D Mannequin" auto-rotate camera-controls style="width: 400px; height: 400px;"> </model-viewer> """ ) # User input + AI feedback with gr.Column(): user_input = gr.Textbox(label="Describe your surgical action") feedback = gr.Textbox(label="AI Feedback") user_input.submit(surgical_feedback, user_input, feedback) demo.launch()
Verified signaturea01cf00 -
gradio
Verified signature6a0f40e -
import gradio as gr # Simple AI feedback logic def surgical_feedback(action_description): action = action_description.lower() if "scalpel too high" in action: return "Gabanya umuvuduko w'igikoresho." elif "cut too deep" in action: return "Gabanya depth y'igikata." elif "incorrect angle" in action: return "Hindura angle y'igikoresho." else: return "Byiza! Komeza gutya." with gr.Blocks() as demo: gr.Markdown("# Surgical Training AI Prototype") gr.Markdown( "Reba mannequin hasi, wandike uko wakoze igikorwa, AI izaguha feedback." ) with gr.Row(): # Left: 3D mannequin embed gr.HTML( """ <model-viewer src="assets/mannequin.glb" alt="3D Mannequin" auto-rotate camera-controls style="width: 400px; height: 400px;"> </model-viewer> """ ) # Right: User input + AI feedback with gr.Column(): user_input = gr.Textbox(label="Describe your surgical action") feedback = gr.Textbox(label="AI Feedback") user_input.submit(surgical_feedback, user_input, feedback) demo.launch()
Verified signature1367b8e -
initial commit
Verified signature2dcdbfe