leonelhs commited on
Commit
c03c9bc
1 Parent(s): 1f62380

fis model path

Browse files
Files changed (3) hide show
  1. .gitignore +0 -1
  2. app.py +0 -15
  3. models/ColorizeArtistic_gen.pth +3 -0
.gitignore CHANGED
@@ -1,6 +1,5 @@
1
  .idea/
2
  __pycache__/
3
- models0/
4
  flagged/
5
  result_images/
6
 
 
1
  .idea/
2
  __pycache__/
 
3
  flagged/
4
  result_images/
5
 
app.py CHANGED
@@ -1,31 +1,16 @@
1
  import os
2
  import warnings
3
- from pathlib import Path
4
 
5
  import gradio as gr
6
  from deoldify import device
7
  from deoldify.device_id import DeviceId
8
  from deoldify.visualize import get_image_colorizer
9
- from huggingface_hub import snapshot_download
10
 
11
  os.system("pip freeze")
12
  warnings.filterwarnings("ignore", category=UserWarning, message=".*?Your .*? set is empty.*?")
13
 
14
  device.set(device=DeviceId.CPU)
15
 
16
- REPO_ID = "leonelhs/deoldify"
17
- MODEL_NAME = "ColorizeArtistic_gen.pth"
18
-
19
- model_path = Path("./models")
20
- snapshot_folder = snapshot_download(repo_id=REPO_ID)
21
- model_path_hf = Path(snapshot_folder).joinpath(MODEL_NAME)
22
-
23
- Path.mkdir(model_path, exist_ok=True)
24
- try:
25
- Path.symlink_to(model_path.joinpath(MODEL_NAME), model_path_hf)
26
- except FileExistsError:
27
- pass
28
-
29
  device.set(device=DeviceId.GPU0)
30
  colorizer = get_image_colorizer(artistic=True)
31
 
 
1
  import os
2
  import warnings
 
3
 
4
  import gradio as gr
5
  from deoldify import device
6
  from deoldify.device_id import DeviceId
7
  from deoldify.visualize import get_image_colorizer
 
8
 
9
  os.system("pip freeze")
10
  warnings.filterwarnings("ignore", category=UserWarning, message=".*?Your .*? set is empty.*?")
11
 
12
  device.set(device=DeviceId.CPU)
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  device.set(device=DeviceId.GPU0)
15
  colorizer = get_image_colorizer(artistic=True)
16
 
models/ColorizeArtistic_gen.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f750246fa220529323b85a8905f9b49c0e5d427099185334d048fb5b5e22477
3
+ size 255144681