Commit
·
aab82ab
1
Parent(s):
184cb45
Update app.py
Browse files
app.py
CHANGED
@@ -175,7 +175,8 @@ class CreateDatasetProd():
|
|
175 |
def create_dataset(self, video_paths):
|
176 |
# Read and process Videos
|
177 |
video = self.read_video(video_paths)
|
178 |
-
video =
|
|
|
179 |
video = self.add_landmarks(video)
|
180 |
# Data Preperation for ML Model without Augmentation
|
181 |
video = self.transform_prod(video.permute(0, 3, 1, 2))
|
@@ -265,7 +266,7 @@ with gr.Blocks() as demo:
|
|
265 |
gr.Markdown("# Indian Sign Language Translation App")
|
266 |
with gr.Tab("Gesture recognition"):
|
267 |
# Add webcam input for sign language video capture
|
268 |
-
video_input = gr.Video()
|
269 |
# Add a button or functionality to process the video
|
270 |
test_output = gr.Textbox()
|
271 |
# Submit the Video
|
|
|
175 |
def create_dataset(self, video_paths):
|
176 |
# Read and process Videos
|
177 |
video = self.read_video(video_paths)
|
178 |
+
video = torch.from_numpy(video.asnumpy())
|
179 |
+
video = transforms.v2.functional.resize(video.transpose(0, 3, 1, 2), size=(self.clip_size*2, self.clip_size*3)) # Auto converts to (F, C, H, W) format
|
180 |
video = self.add_landmarks(video)
|
181 |
# Data Preperation for ML Model without Augmentation
|
182 |
video = self.transform_prod(video.permute(0, 3, 1, 2))
|
|
|
266 |
gr.Markdown("# Indian Sign Language Translation App")
|
267 |
with gr.Tab("Gesture recognition"):
|
268 |
# Add webcam input for sign language video capture
|
269 |
+
video_input = gr.Video(format="mp4")
|
270 |
# Add a button or functionality to process the video
|
271 |
test_output = gr.Textbox()
|
272 |
# Submit the Video
|