fffiloni commited on
Commit
eef129e
1 Parent(s): b3003aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -11
app.py CHANGED
@@ -57,17 +57,11 @@ def pix2pix(
57
  )
58
 
59
  # return replace_nsfw_images(result)
60
- return result.images, result.nsfw_content_detected, seed
61
  except Exception as e:
62
- return None, None, error_str(e)
 
63
 
64
- def error_str(error, title="Error"):
65
- return (
66
- f"""#### {title}
67
- {error}"""
68
- if error
69
- else ""
70
- )
71
 
72
  def get_frames(video_in):
73
  frames = []
@@ -132,8 +126,8 @@ def infer(prompt,video_in, seed_in, trim_value):
132
 
133
  for i in frames_list[0:int(n_frame)]:
134
  pix2pix_img = pix2pix(prompt,5.5,1.5,i,15,"",512,512,seed_in)
135
- images = pix2pix_img[0]
136
- rgb_im = images[0].convert("RGB")
137
 
138
  # exporting the image
139
  rgb_im.save(f"result_img-{i}.jpg")
 
57
  )
58
 
59
  # return replace_nsfw_images(result)
60
+ return result[0]
61
  except Exception as e:
62
+ return None
63
+
64
 
 
 
 
 
 
 
 
65
 
66
  def get_frames(video_in):
67
  frames = []
 
126
 
127
  for i in frames_list[0:int(n_frame)]:
128
  pix2pix_img = pix2pix(prompt,5.5,1.5,i,15,"",512,512,seed_in)
129
+ image = pix2pix_img
130
+ rgb_im = image.convert("RGB")
131
 
132
  # exporting the image
133
  rgb_im.save(f"result_img-{i}.jpg")