radames commited on
Commit
58845cd
1 Parent(s): a0bcaae

download from hub

Browse files
Files changed (2) hide show
  1. requirements.txt +3 -1
  2. visualizer_drag_gradio.py +7 -0
requirements.txt CHANGED
@@ -17,4 +17,6 @@ pyopengl==3.1.5
17
  imageio-ffmpeg==0.4.3
18
  pyspng
19
  Ninja
20
- gradio
 
 
 
17
  imageio-ffmpeg==0.4.3
18
  pyspng
19
  Ninja
20
+ gradio
21
+ huggingface_hub
22
+ hf_transfer
visualizer_drag_gradio.py CHANGED
@@ -2,6 +2,8 @@ import os
2
  import os.path as osp
3
  from argparse import ArgumentParser
4
  from functools import partial
 
 
5
 
6
  import gradio as gr
7
  import numpy as np
@@ -14,6 +16,11 @@ from gradio_utils import (ImageMask, draw_mask_on_image, draw_points_on_image,
14
  on_change_single_global_state)
15
  from viz.renderer import Renderer, add_watermark_np
16
 
 
 
 
 
 
17
  parser = ArgumentParser()
18
  parser.add_argument('--share', action='store_true')
19
  parser.add_argument('--cache-dir', type=str, default='./checkpoints')
 
2
  import os.path as osp
3
  from argparse import ArgumentParser
4
  from functools import partial
5
+ from huggingface_hub import snapshot_download
6
+ from pathlib import Path
7
 
8
  import gradio as gr
9
  import numpy as np
 
16
  on_change_single_global_state)
17
  from viz.renderer import Renderer, add_watermark_np
18
 
19
+
20
+ # download models from hub
21
+ model_dir = Path('./checkpoints')
22
+ snapshot_download('radames/DragGan', repo_type='model', local_dir=model_dir)
23
+
24
  parser = ArgumentParser()
25
  parser.add_argument('--share', action='store_true')
26
  parser.add_argument('--cache-dir', type=str, default='./checkpoints')