Update run.py
Browse files
run.py
CHANGED
@@ -34,6 +34,7 @@ model.to(device).eval()
|
|
34 |
# counter = Count()
|
35 |
|
36 |
def segment(im, interval_s=2):
|
|
|
37 |
# if (counter.imout.sum() == 0) or ((cnt % 100) == 0):
|
38 |
pixel_values = image_processor(im, return_tensors="pt").pixel_values.to(device)
|
39 |
outputs = model(pixel_values=pixel_values)
|
@@ -75,6 +76,7 @@ demo = gr.Interface(
|
|
75 |
outputs=["image"],
|
76 |
title="Image Inference",
|
77 |
cache_examples=False,
|
|
|
78 |
)
|
79 |
|
80 |
if __name__ == "__main__":
|
|
|
34 |
# counter = Count()
|
35 |
|
36 |
def segment(im, interval_s=2):
|
37 |
+
print(im)
|
38 |
# if (counter.imout.sum() == 0) or ((cnt % 100) == 0):
|
39 |
pixel_values = image_processor(im, return_tensors="pt").pixel_values.to(device)
|
40 |
outputs = model(pixel_values=pixel_values)
|
|
|
76 |
outputs=["image"],
|
77 |
title="Image Inference",
|
78 |
cache_examples=False,
|
79 |
+
live=True
|
80 |
)
|
81 |
|
82 |
if __name__ == "__main__":
|