Update run.py
Browse files
run.py
CHANGED
@@ -38,12 +38,11 @@ model.to(device).eval()
|
|
38 |
# counter = Count()
|
39 |
|
40 |
def segment(im, interval_s=2):
|
41 |
-
|
42 |
-
counter.increment()
|
43 |
im = cv2.resize(im, (im.shape[1] // 2, im.shape[0] // 2))
|
44 |
imout = im.copy()
|
45 |
|
46 |
-
if
|
47 |
# if (counter.imout.sum() == 0) or ((cnt % 100) == 0):
|
48 |
pixel_values = image_processor(im, return_tensors="pt").pixel_values.to(device)
|
49 |
outputs = model(pixel_values=pixel_values)
|
|
|
38 |
# counter = Count()
|
39 |
|
40 |
def segment(im, interval_s=2):
|
41 |
+
|
|
|
42 |
im = cv2.resize(im, (im.shape[1] // 2, im.shape[0] // 2))
|
43 |
imout = im.copy()
|
44 |
|
45 |
+
if counter.increment() % 3 == 0:
|
46 |
# if (counter.imout.sum() == 0) or ((cnt % 100) == 0):
|
47 |
pixel_values = image_processor(im, return_tensors="pt").pixel_values.to(device)
|
48 |
outputs = model(pixel_values=pixel_values)
|