jaekookang commited on
Commit
21db8ab
1 Parent(s): 6bf7bb2
gradio_painttransformer.py CHANGED
@@ -16,7 +16,6 @@ import gradio as gr
16
 
17
  import paddle
18
  import render_utils
19
- import render_parallel
20
  import render_serial
21
 
22
  # ---------- Settings ----------
 
16
 
17
  import paddle
18
  import render_utils
 
19
  import render_serial
20
 
21
  # ---------- Settings ----------
render_serial.py CHANGED
@@ -8,7 +8,7 @@ import paddle.nn.functional as F
8
  import numpy as np
9
  from PIL import Image
10
  import math
11
- import cv2
12
  import render_utils
13
  import time
14
 
 
8
  import numpy as np
9
  from PIL import Image
10
  import math
11
+ # import cv2
12
  import render_utils
13
  import time
14
 
render_utils.py CHANGED
@@ -82,11 +82,11 @@ def read_img(img_path, img_type='RGB', h=None, w=None):
82
  img = paddle.to_tensor(img).unsqueeze(0).astype('float32') / 255.
83
  return img
84
 
85
- def preprocess(img, w=512, h=512):
86
- image = cv2.resize(img, (w, h), cv2.INTER_NEAREST)
87
- image = image.transpose((2, 0, 1))
88
- image = paddle.to_tensor(image).unsqueeze(0).astype('float32') / 255.
89
- return image
90
 
91
  def pad(img, H, W):
92
  b, c, h, w = img.shape
 
82
  img = paddle.to_tensor(img).unsqueeze(0).astype('float32') / 255.
83
  return img
84
 
85
+ # def preprocess(img, w=512, h=512):
86
+ # image = cv2.resize(img, (w, h), cv2.INTER_NEAREST)
87
+ # image = image.transpose((2, 0, 1))
88
+ # image = paddle.to_tensor(image).unsqueeze(0).astype('float32') / 255.
89
+ # return image
90
 
91
  def pad(img, H, W):
92
  b, c, h, w = img.shape