Update run.py
Browse files
run.py
CHANGED
@@ -42,14 +42,14 @@ def segment(im, interval_s=2):
|
|
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 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
return imout, counter.count #np.flipud(im)
|
54 |
|
55 |
# with gr.Blocks() as demo:
|
|
|
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)
|
49 |
+
# logits = outputs.logits.cpu().detach().numpy() ** 2
|
50 |
+
# logits_n = (logits[0, 0] - logits[0, 0].min()) / (logits[0, 0].max() - logits[0, 0].min())
|
51 |
+
# logits_n = cv2.resize(logits_n, (im.shape[1], im.shape[0]))
|
52 |
+
# imout[..., 1] = np.clip(imout[..., 1] + logits_n * 200, 0, 254)
|
53 |
return imout, counter.count #np.flipud(im)
|
54 |
|
55 |
# with gr.Blocks() as demo:
|