Commit History

adding these print statements, we can check if the landmarks are being correctly extracted and if the number of landmarks is as expected for each category
0dded4a

JefferyJapheth commited on

added webcam_interface = gr.Interface( fn=predict_with_webcam, inputs=gr.inputs.Image(shape=(480, 640), source="webcam"), outputs=gr.outputs.Label(), # Use "Label" type instead of "Textbox" live=True, interpretation="default", title="Webcam Landmark Prediction", description="Make predictions using landmarks extracted from your webcam stream.", )
60eabb7

JefferyJapheth commited on

added webcam_interface = gr.Interface( fn=predict_with_webcam, inputs=gr.inputs.Image(shape=(480, 640), source="webcam"), outputs=gr.outputs.Textbox(), # Use "Textbox" type instead of "Label" live=True, interpretation="default", title="Webcam Landmark Prediction", description="Make predictions using landmarks extracted from your webcam stream.", )
2abb6d3

JefferyJapheth commited on

modified make prediction and added inv_index_to_class = {v: k for k, v in index_to_class.items()}
27ae852

JefferyJapheth commited on

added # Modify the Gradio interface to use a "label" type output instead of "textbox" webcam_interface = gr.Interface( fn=predict_with_webcam, inputs=gr.inputs.Image(shape=(480, 640), source="webcam"), outputs=gr.outputs.Label(), # Use "label" type instead of "textbox" live=True, interpretation="default", title="Webcam Landmark Prediction", description="Make predictions using landmarks extracted from your webcam stream.", )
03fbdcd

JefferyJapheth commited on

move the np.concatenate line inside the extract_keypoints function and make sure to return the concatenated array
c1192a3

JefferyJapheth commited on

modified # Function to perform holistic detection using Mediapipe def mediapipe_detection(image, model): # COLOR CONVERSION BGR 2 RGB image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) image_rgb.flags.writeable = False # Image is no longer writeable results = model.process(image_rgb) # Make prediction image_rgb.flags.writeable = True # Image is now writeable image_bgr = cv2.cvtColor(image_rgb, cv2.COLOR_RGB2BGR) # COLOR CONVERSION RGB 2 BGR return image_bgr, results
914e870

JefferyJapheth commited on

defined mp_holistic in predict with webcam fn
6b1e533

JefferyJapheth commited on

specifying the webcam source explicitly by passing the webcam ID as an argument to the gr.Interface function.
bd4424b

JefferyJapheth commited on

app with exception handling for face landmark
2165cdc

JefferyJapheth commited on

moved cap = cv2.VideoCapture(0) to the top
02030b1

JefferyJapheth commited on

fixing return prediction outside function
2ae007c

JefferyJapheth commited on

new make_prediction and predict_with_webcam
5faf21e

JefferyJapheth commited on

removed multiple : cap = cv2.VideoCapture(0)
13cc7b5

JefferyJapheth commited on

auto indent, reformat code.
21ed3a6

JefferyJapheth commited on

deleted multiple and left one "with mp_holistic.Holistic(min_detection_confidence=0.5, min_tracking_confidence=0.5) as holistic:"
3535ae8

JefferyJapheth commited on

put face 1st in the order of landmark extraction
dd22aa4

JefferyJapheth commited on

redefined predict_with_webcam . With this modification, the input tensor passed to the PreprocessLayer should have the correct shape, and the error should be resolved.
31a741d

JefferyJapheth commited on

added N_ROWS = 543 N_DIMS = 3 DIM_NAMES = ['x', 'y', 'z'] SEED = 42 NUM_CLASSES = 250
7d38abd

JefferyJapheth commited on

re-modified code with mediapipe and webcam initialized
e156e53

JefferyJapheth commited on

adding type numpy to image input
5115c05

JefferyJapheth commited on

printing processed landmarks
5481cc1

JefferyJapheth commited on

redefined predict_with_webcam function to return "Could not detect landmarks. Make sure your webcam is working properly."
bc3cf69

JefferyJapheth commited on

redefined how the webcam is launched
5ebde55

JefferyJapheth commited on

modified predict_with_webcam to continuously predict output.
824a609

JefferyJapheth commited on