noamholz commited on
Commit
dee36c9
·
verified ·
1 Parent(s): 7c3d23b

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +2 -3
run.py CHANGED
@@ -38,12 +38,11 @@ model.to(device).eval()
38
  # counter = Count()
39
 
40
  def segment(im, interval_s=2):
41
- global counter
42
- counter.increment()
43
  im = cv2.resize(im, (im.shape[1] // 2, im.shape[0] // 2))
44
  imout = im.copy()
45
 
46
- if cnt % 10 == 0:
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)