DmitrMakeev commited on
Commit
5ceb3c0
·
1 Parent(s): c9f3f27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -9,7 +9,9 @@ if RUN_MODE != "local":
9
  os.system("wget https://huggingface.co/menghanxia/disco/resolve/main/disco-beta.pth.rar")
10
  os.rename("disco-beta.pth.rar", "./checkpoints/disco-beta.pth.rar")
11
  ## examples
12
-
 
 
13
  os.system("wget https://huggingface.co/menghanxia/disco/resolve/main/04.jpg")
14
 
15
  ## step 1: set up model
@@ -20,9 +22,8 @@ colorizer, colorLabeler = setup_model(checkpt_path, device=device)
20
  def click_colorize(rgb_img, hint_img, n_anchors, is_high_res, is_editable):
21
  if hint_img is None:
22
  hint_img = rgb_img
23
- output = colorize_grayscale(colorizer, colorLabeler, rgb_img, hint_img, n_anchors, True, is_editable, device)
24
- output1 = colorize_grayscale(colorizer, colorLabeler, rgb_img, hint_img, n_anchors, False, is_editable, device)
25
- return output, output1
26
 
27
  def click_predanchors(rgb_img, n_anchors, is_high_res, is_editable):
28
  output = predict_anchors(colorizer, colorLabeler, rgb_img, n_anchors, is_high_res, is_editable, device)
 
9
  os.system("wget https://huggingface.co/menghanxia/disco/resolve/main/disco-beta.pth.rar")
10
  os.rename("disco-beta.pth.rar", "./checkpoints/disco-beta.pth.rar")
11
  ## examples
12
+ os.system("wget https://huggingface.co/menghanxia/disco/resolve/main/01.jpg")
13
+ os.system("wget https://huggingface.co/menghanxia/disco/resolve/main/02.jpg")
14
+ os.system("wget https://huggingface.co/menghanxia/disco/resolve/main/03.jpg")
15
  os.system("wget https://huggingface.co/menghanxia/disco/resolve/main/04.jpg")
16
 
17
  ## step 1: set up model
 
22
  def click_colorize(rgb_img, hint_img, n_anchors, is_high_res, is_editable):
23
  if hint_img is None:
24
  hint_img = rgb_img
25
+ output = colorize_grayscale(colorizer, colorLabeler, rgb_img, hint_img, n_anchors, is_high_res, is_editable, device)
26
+ return output
 
27
 
28
  def click_predanchors(rgb_img, n_anchors, is_high_res, is_editable):
29
  output = predict_anchors(colorizer, colorLabeler, rgb_img, n_anchors, is_high_res, is_editable, device)