jimmycv07 commited on
Commit
4328033
β€’
1 Parent(s): 7b8a88a

uploaded videos from users

Browse files
Files changed (45) hide show
  1. DiffIR2VR_fps_10.mp4 +0 -0
  2. GMFlow/gmflow/__pycache__/__init__.cpython-310.pyc +0 -0
  3. GMFlow/gmflow/__pycache__/backbone.cpython-310.pyc +0 -0
  4. GMFlow/gmflow/__pycache__/geometry.cpython-310.pyc +0 -0
  5. GMFlow/gmflow/__pycache__/gmflow.cpython-310.pyc +0 -0
  6. GMFlow/gmflow/__pycache__/matching.cpython-310.pyc +0 -0
  7. GMFlow/gmflow/__pycache__/position.cpython-310.pyc +0 -0
  8. GMFlow/gmflow/__pycache__/transformer.cpython-310.pyc +0 -0
  9. GMFlow/gmflow/__pycache__/trident_conv.cpython-310.pyc +0 -0
  10. GMFlow/gmflow/__pycache__/utils.cpython-310.pyc +0 -0
  11. GMFlow/utils/__pycache__/utils.cpython-310.pyc +0 -0
  12. app.py +31 -3
  13. controller/__pycache__/controller.cpython-310.pyc +0 -0
  14. model/__pycache__/__init__.cpython-310.pyc +0 -0
  15. model/__pycache__/attention.cpython-310.pyc +0 -0
  16. model/__pycache__/bsrnet.cpython-310.pyc +0 -0
  17. model/__pycache__/cldm.cpython-310.pyc +0 -0
  18. model/__pycache__/clip.cpython-310.pyc +0 -0
  19. model/__pycache__/config.cpython-310.pyc +0 -0
  20. model/__pycache__/controlnet.cpython-310.pyc +0 -0
  21. model/__pycache__/distributions.cpython-310.pyc +0 -0
  22. model/__pycache__/gaussian_diffusion.cpython-310.pyc +0 -0
  23. model/__pycache__/scunet.cpython-310.pyc +0 -0
  24. model/__pycache__/swinir.cpython-310.pyc +0 -0
  25. model/__pycache__/unet.cpython-310.pyc +0 -0
  26. model/__pycache__/util.cpython-310.pyc +0 -0
  27. model/__pycache__/vae.cpython-310.pyc +0 -0
  28. model/open_clip/__pycache__/__init__.cpython-310.pyc +0 -0
  29. model/open_clip/__pycache__/model.cpython-310.pyc +0 -0
  30. model/open_clip/__pycache__/tokenizer.cpython-310.pyc +0 -0
  31. model/open_clip/__pycache__/transformer.cpython-310.pyc +0 -0
  32. utils/__pycache__/batch_inference.cpython-310.pyc +0 -0
  33. utils/__pycache__/common.cpython-310.pyc +0 -0
  34. utils/__pycache__/cond_fn.cpython-310.pyc +0 -0
  35. utils/__pycache__/face_restoration_helper.cpython-310.pyc +0 -0
  36. utils/__pycache__/flow_utils.cpython-310.pyc +0 -0
  37. utils/__pycache__/helpers.cpython-310.pyc +0 -0
  38. utils/__pycache__/image_utils.cpython-310.pyc +0 -0
  39. utils/__pycache__/sampler.cpython-310.pyc +0 -0
  40. utils/__pycache__/video_visualizer.cpython-310.pyc +0 -0
  41. utils/batch_inference.py +0 -1
  42. vidtome/__pycache__/__init__.cpython-310.pyc +0 -0
  43. vidtome/__pycache__/merge.cpython-310.pyc +0 -0
  44. vidtome/__pycache__/patch.cpython-310.pyc +0 -0
  45. vidtome/__pycache__/utils.cpython-310.pyc +0 -0
DiffIR2VR_fps_10.mp4 CHANGED
Binary files a/DiffIR2VR_fps_10.mp4 and b/DiffIR2VR_fps_10.mp4 differ
 
GMFlow/gmflow/__pycache__/__init__.cpython-310.pyc CHANGED
Binary files a/GMFlow/gmflow/__pycache__/__init__.cpython-310.pyc and b/GMFlow/gmflow/__pycache__/__init__.cpython-310.pyc differ
 
GMFlow/gmflow/__pycache__/backbone.cpython-310.pyc CHANGED
Binary files a/GMFlow/gmflow/__pycache__/backbone.cpython-310.pyc and b/GMFlow/gmflow/__pycache__/backbone.cpython-310.pyc differ
 
GMFlow/gmflow/__pycache__/geometry.cpython-310.pyc CHANGED
Binary files a/GMFlow/gmflow/__pycache__/geometry.cpython-310.pyc and b/GMFlow/gmflow/__pycache__/geometry.cpython-310.pyc differ
 
GMFlow/gmflow/__pycache__/gmflow.cpython-310.pyc CHANGED
Binary files a/GMFlow/gmflow/__pycache__/gmflow.cpython-310.pyc and b/GMFlow/gmflow/__pycache__/gmflow.cpython-310.pyc differ
 
GMFlow/gmflow/__pycache__/matching.cpython-310.pyc CHANGED
Binary files a/GMFlow/gmflow/__pycache__/matching.cpython-310.pyc and b/GMFlow/gmflow/__pycache__/matching.cpython-310.pyc differ
 
GMFlow/gmflow/__pycache__/position.cpython-310.pyc CHANGED
Binary files a/GMFlow/gmflow/__pycache__/position.cpython-310.pyc and b/GMFlow/gmflow/__pycache__/position.cpython-310.pyc differ
 
GMFlow/gmflow/__pycache__/transformer.cpython-310.pyc CHANGED
Binary files a/GMFlow/gmflow/__pycache__/transformer.cpython-310.pyc and b/GMFlow/gmflow/__pycache__/transformer.cpython-310.pyc differ
 
GMFlow/gmflow/__pycache__/trident_conv.cpython-310.pyc CHANGED
Binary files a/GMFlow/gmflow/__pycache__/trident_conv.cpython-310.pyc and b/GMFlow/gmflow/__pycache__/trident_conv.cpython-310.pyc differ
 
GMFlow/gmflow/__pycache__/utils.cpython-310.pyc CHANGED
Binary files a/GMFlow/gmflow/__pycache__/utils.cpython-310.pyc and b/GMFlow/gmflow/__pycache__/utils.cpython-310.pyc differ
 
GMFlow/utils/__pycache__/utils.cpython-310.pyc CHANGED
Binary files a/GMFlow/utils/__pycache__/utils.cpython-310.pyc and b/GMFlow/utils/__pycache__/utils.cpython-310.pyc differ
 
app.py CHANGED
@@ -84,7 +84,34 @@ def images_to_video(image_list, output_path, fps=10):
84
 
85
  writer.close()
86
 
 
 
 
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
 
89
  @spaces.GPU(duration=120)
90
  def DiffBIR_restore(input_video, prompt, sr_ratio, n_frames, n_steps, guidance_scale, seed, n_prompt, task):
@@ -93,7 +120,8 @@ def DiffBIR_restore(input_video, prompt, sr_ratio, n_frames, n_steps, guidance_s
93
  if video_name in video_to_image:
94
  frames_path = video_to_image[video_name][0]
95
  else:
96
- return None
 
97
  print(f"[INFO] input_video: {input_video}")
98
  print(f"[INFO] Frames path: {frames_path}")
99
  args = argparse.Namespace()
@@ -195,7 +223,7 @@ with gr.Blocks(css="style.css") as demo:
195
  n_steps = gr.Slider(label='Steps',
196
  minimum=1,
197
  maximum=100,
198
- value=10,
199
  step=1)
200
  guidance_scale = gr.Slider(label='Guidance Scale',
201
  minimum=0.1,
@@ -262,7 +290,7 @@ with gr.Blocks(css="style.css") as demo:
262
  n_steps = gr.Slider(label='Steps',
263
  minimum=1,
264
  maximum=100,
265
- value=10,
266
  step=1)
267
  guidance_scale = gr.Slider(label='Guidance Scale',
268
  minimum=0.1,
 
84
 
85
  writer.close()
86
 
87
+ def video2frames(video_path):
88
+ # Open the video file
89
+ video = cv2.VideoCapture(video_path)
90
 
91
+ img_path = video_path[:-4]
92
+ # Initialize frame counter
93
+ frame_count = 0
94
+ os.makedirs(img_path, exist_ok=True)
95
+
96
+ while True:
97
+ # Read a frame from the video
98
+ ret, frame = video.read()
99
+
100
+ # If the frame was not successfully read, then we have reached the end of the video
101
+ if not ret:
102
+ break
103
+
104
+ # Write the frame to a JPG file
105
+ frame_file = f"{img_path}/{frame_count:05}.jpg"
106
+ cv2.imwrite(frame_file, frame)
107
+
108
+ # Increment the frame counter
109
+ frame_count += 1
110
+
111
+ # Release the video file
112
+ video.release()
113
+
114
+ return img_path
115
 
116
  @spaces.GPU(duration=120)
117
  def DiffBIR_restore(input_video, prompt, sr_ratio, n_frames, n_steps, guidance_scale, seed, n_prompt, task):
 
120
  if video_name in video_to_image:
121
  frames_path = video_to_image[video_name][0]
122
  else:
123
+ frames_path = video2frames(input_video)
124
+
125
  print(f"[INFO] input_video: {input_video}")
126
  print(f"[INFO] Frames path: {frames_path}")
127
  args = argparse.Namespace()
 
223
  n_steps = gr.Slider(label='Steps',
224
  minimum=1,
225
  maximum=100,
226
+ value=5,
227
  step=1)
228
  guidance_scale = gr.Slider(label='Guidance Scale',
229
  minimum=0.1,
 
290
  n_steps = gr.Slider(label='Steps',
291
  minimum=1,
292
  maximum=100,
293
+ value=5,
294
  step=1)
295
  guidance_scale = gr.Slider(label='Guidance Scale',
296
  minimum=0.1,
controller/__pycache__/controller.cpython-310.pyc CHANGED
Binary files a/controller/__pycache__/controller.cpython-310.pyc and b/controller/__pycache__/controller.cpython-310.pyc differ
 
model/__pycache__/__init__.cpython-310.pyc CHANGED
Binary files a/model/__pycache__/__init__.cpython-310.pyc and b/model/__pycache__/__init__.cpython-310.pyc differ
 
model/__pycache__/attention.cpython-310.pyc CHANGED
Binary files a/model/__pycache__/attention.cpython-310.pyc and b/model/__pycache__/attention.cpython-310.pyc differ
 
model/__pycache__/bsrnet.cpython-310.pyc CHANGED
Binary files a/model/__pycache__/bsrnet.cpython-310.pyc and b/model/__pycache__/bsrnet.cpython-310.pyc differ
 
model/__pycache__/cldm.cpython-310.pyc CHANGED
Binary files a/model/__pycache__/cldm.cpython-310.pyc and b/model/__pycache__/cldm.cpython-310.pyc differ
 
model/__pycache__/clip.cpython-310.pyc CHANGED
Binary files a/model/__pycache__/clip.cpython-310.pyc and b/model/__pycache__/clip.cpython-310.pyc differ
 
model/__pycache__/config.cpython-310.pyc CHANGED
Binary files a/model/__pycache__/config.cpython-310.pyc and b/model/__pycache__/config.cpython-310.pyc differ
 
model/__pycache__/controlnet.cpython-310.pyc CHANGED
Binary files a/model/__pycache__/controlnet.cpython-310.pyc and b/model/__pycache__/controlnet.cpython-310.pyc differ
 
model/__pycache__/distributions.cpython-310.pyc CHANGED
Binary files a/model/__pycache__/distributions.cpython-310.pyc and b/model/__pycache__/distributions.cpython-310.pyc differ
 
model/__pycache__/gaussian_diffusion.cpython-310.pyc CHANGED
Binary files a/model/__pycache__/gaussian_diffusion.cpython-310.pyc and b/model/__pycache__/gaussian_diffusion.cpython-310.pyc differ
 
model/__pycache__/scunet.cpython-310.pyc CHANGED
Binary files a/model/__pycache__/scunet.cpython-310.pyc and b/model/__pycache__/scunet.cpython-310.pyc differ
 
model/__pycache__/swinir.cpython-310.pyc CHANGED
Binary files a/model/__pycache__/swinir.cpython-310.pyc and b/model/__pycache__/swinir.cpython-310.pyc differ
 
model/__pycache__/unet.cpython-310.pyc CHANGED
Binary files a/model/__pycache__/unet.cpython-310.pyc and b/model/__pycache__/unet.cpython-310.pyc differ
 
model/__pycache__/util.cpython-310.pyc CHANGED
Binary files a/model/__pycache__/util.cpython-310.pyc and b/model/__pycache__/util.cpython-310.pyc differ
 
model/__pycache__/vae.cpython-310.pyc CHANGED
Binary files a/model/__pycache__/vae.cpython-310.pyc and b/model/__pycache__/vae.cpython-310.pyc differ
 
model/open_clip/__pycache__/__init__.cpython-310.pyc CHANGED
Binary files a/model/open_clip/__pycache__/__init__.cpython-310.pyc and b/model/open_clip/__pycache__/__init__.cpython-310.pyc differ
 
model/open_clip/__pycache__/model.cpython-310.pyc CHANGED
Binary files a/model/open_clip/__pycache__/model.cpython-310.pyc and b/model/open_clip/__pycache__/model.cpython-310.pyc differ
 
model/open_clip/__pycache__/tokenizer.cpython-310.pyc CHANGED
Binary files a/model/open_clip/__pycache__/tokenizer.cpython-310.pyc and b/model/open_clip/__pycache__/tokenizer.cpython-310.pyc differ
 
model/open_clip/__pycache__/transformer.cpython-310.pyc CHANGED
Binary files a/model/open_clip/__pycache__/transformer.cpython-310.pyc and b/model/open_clip/__pycache__/transformer.cpython-310.pyc differ
 
utils/__pycache__/batch_inference.cpython-310.pyc CHANGED
Binary files a/utils/__pycache__/batch_inference.cpython-310.pyc and b/utils/__pycache__/batch_inference.cpython-310.pyc differ
 
utils/__pycache__/common.cpython-310.pyc CHANGED
Binary files a/utils/__pycache__/common.cpython-310.pyc and b/utils/__pycache__/common.cpython-310.pyc differ
 
utils/__pycache__/cond_fn.cpython-310.pyc CHANGED
Binary files a/utils/__pycache__/cond_fn.cpython-310.pyc and b/utils/__pycache__/cond_fn.cpython-310.pyc differ
 
utils/__pycache__/face_restoration_helper.cpython-310.pyc CHANGED
Binary files a/utils/__pycache__/face_restoration_helper.cpython-310.pyc and b/utils/__pycache__/face_restoration_helper.cpython-310.pyc differ
 
utils/__pycache__/flow_utils.cpython-310.pyc CHANGED
Binary files a/utils/__pycache__/flow_utils.cpython-310.pyc and b/utils/__pycache__/flow_utils.cpython-310.pyc differ
 
utils/__pycache__/helpers.cpython-310.pyc CHANGED
Binary files a/utils/__pycache__/helpers.cpython-310.pyc and b/utils/__pycache__/helpers.cpython-310.pyc differ
 
utils/__pycache__/image_utils.cpython-310.pyc CHANGED
Binary files a/utils/__pycache__/image_utils.cpython-310.pyc and b/utils/__pycache__/image_utils.cpython-310.pyc differ
 
utils/__pycache__/sampler.cpython-310.pyc CHANGED
Binary files a/utils/__pycache__/sampler.cpython-310.pyc and b/utils/__pycache__/sampler.cpython-310.pyc differ
 
utils/__pycache__/video_visualizer.cpython-310.pyc CHANGED
Binary files a/utils/__pycache__/video_visualizer.cpython-310.pyc and b/utils/__pycache__/video_visualizer.cpython-310.pyc differ
 
utils/batch_inference.py CHANGED
@@ -148,7 +148,6 @@ class InferenceLoop:
148
 
149
  def batch_lq_loader(self) -> Generator[np.ndarray, None, None]:
150
  img_exts = [".png", ".jpg", ".jpeg"]
151
- print(f"[INFO] input: {self.args.input}")
152
  if os.path.isdir(self.args.input):
153
  file_names = sorted([
154
  file_name for file_name in os.listdir(self.args.input) if os.path.splitext(file_name)[-1] in img_exts
 
148
 
149
  def batch_lq_loader(self) -> Generator[np.ndarray, None, None]:
150
  img_exts = [".png", ".jpg", ".jpeg"]
 
151
  if os.path.isdir(self.args.input):
152
  file_names = sorted([
153
  file_name for file_name in os.listdir(self.args.input) if os.path.splitext(file_name)[-1] in img_exts
vidtome/__pycache__/__init__.cpython-310.pyc CHANGED
Binary files a/vidtome/__pycache__/__init__.cpython-310.pyc and b/vidtome/__pycache__/__init__.cpython-310.pyc differ
 
vidtome/__pycache__/merge.cpython-310.pyc CHANGED
Binary files a/vidtome/__pycache__/merge.cpython-310.pyc and b/vidtome/__pycache__/merge.cpython-310.pyc differ
 
vidtome/__pycache__/patch.cpython-310.pyc CHANGED
Binary files a/vidtome/__pycache__/patch.cpython-310.pyc and b/vidtome/__pycache__/patch.cpython-310.pyc differ
 
vidtome/__pycache__/utils.cpython-310.pyc CHANGED
Binary files a/vidtome/__pycache__/utils.cpython-310.pyc and b/vidtome/__pycache__/utils.cpython-310.pyc differ