Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import numpy as np
|
|
4 |
import cv2
|
5 |
import time
|
6 |
import re
|
|
|
7 |
from PIL import Image
|
8 |
from threading import Thread
|
9 |
from transformers import AutoProcessor, Gemma3ForConditionalGeneration, TextIteratorStreamer
|
@@ -64,6 +65,7 @@ def capture_live_frames(duration=5, num_frames=10):
|
|
64 |
#####################################
|
65 |
# 3. Live Inference Function
|
66 |
#####################################
|
|
|
67 |
def live_inference(duration=5):
|
68 |
"""
|
69 |
Captures live frames from the webcam, builds a prompt, and returns the generated text.
|
|
|
4 |
import cv2
|
5 |
import time
|
6 |
import re
|
7 |
+
import spaces
|
8 |
from PIL import Image
|
9 |
from threading import Thread
|
10 |
from transformers import AutoProcessor, Gemma3ForConditionalGeneration, TextIteratorStreamer
|
|
|
65 |
#####################################
|
66 |
# 3. Live Inference Function
|
67 |
#####################################
|
68 |
+
@spaces.GPU
|
69 |
def live_inference(duration=5):
|
70 |
"""
|
71 |
Captures live frames from the webcam, builds a prompt, and returns the generated text.
|