lsb commited on
Commit
e34fa5d
1 Parent(s): 66ec171
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -45,14 +45,14 @@ def get_seg_mask(img):
45
 
46
  def app(img, prompt):
47
  start_time = datetime.now().timestamp()
48
- old_size = img.size
49
  img = np.array(Image.fromarray(img).resize(working_size))
50
  mask = ban_cars_mask[get_seg_mask(img)]
51
  mask = mask * 255
52
  overlay_img = Image.fromarray(np.stack([img[:, :, 0], mask, img[:,:,2]], axis=-1))
53
  end_time = datetime.now().timestamp()
54
  draw = ImageDraw.Draw(overlay_img)
55
- draw.text((10, 10), f"Old size: {old_size}\nDuration: {int(1000 * (end_time - start_time))}ms\n<{prompt}>", fill=(255, 255, 255))
56
  return overlay_img
57
 
58
  #ideally:
 
45
 
46
  def app(img, prompt):
47
  start_time = datetime.now().timestamp()
48
+ old_size = Image.fromarray(img).size
49
  img = np.array(Image.fromarray(img).resize(working_size))
50
  mask = ban_cars_mask[get_seg_mask(img)]
51
  mask = mask * 255
52
  overlay_img = Image.fromarray(np.stack([img[:, :, 0], mask, img[:,:,2]], axis=-1))
53
  end_time = datetime.now().timestamp()
54
  draw = ImageDraw.Draw(overlay_img)
55
+ draw.text((50, 10), f"Old size: {old_size}\nDuration: {int(1000 * (end_time - start_time))}ms\n<{prompt}>", fill=(255, 255, 255))
56
  return overlay_img
57
 
58
  #ideally: