NDugar commited on
Commit
a4f2a93
·
1 Parent(s): 040f377

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -21,13 +21,13 @@ enable_gpu = torch.cuda.is_available()
21
  map_location = torch.device("cuda") if enable_gpu else "cpu"
22
  from huggingface_hub import hf_hub_download
23
  from fastai.learner import load_learner
 
24
 
25
  model = torch.load("h2z-85epoch.pth",map_location=torch.device('cpu'))
26
  def generate_img(img_path):
27
  img = tf.io.read_file(img_path)
28
  img = tf.image.decode_png(img)
29
  img = tf.expand_dims(img, axis=0)
30
- img = preprocess_test_image(img)
31
  prediction = model(img, training=False)
32
  return prediction
33
 
 
21
  map_location = torch.device("cuda") if enable_gpu else "cpu"
22
  from huggingface_hub import hf_hub_download
23
  from fastai.learner import load_learner
24
+ import tensorflow as tf
25
 
26
  model = torch.load("h2z-85epoch.pth",map_location=torch.device('cpu'))
27
  def generate_img(img_path):
28
  img = tf.io.read_file(img_path)
29
  img = tf.image.decode_png(img)
30
  img = tf.expand_dims(img, axis=0)
 
31
  prediction = model(img, training=False)
32
  return prediction
33