Skip to content

Commit

Permalink
download examples from huggingface to save repo space
Browse files Browse the repository at this point in the history
Former-commit-id: 0153fdb51aeadccba68e409c8fdeed3e7ce3e166 [formerly acce2f40d8a672f1b615e0223d2a3002cfe639d7] [formerly 14a1e2153ab8a7ad78d48df1a7bfb89e3489c68e [formerly 48a25858d0dcf72f530b0fe80669183b4e811bc5]]
Former-commit-id: 97349017031d46fba799d4114f7100db55901435 [formerly a86f3215762d60db7bd759a8688790eedd87fa12]
Former-commit-id: d1efad2d7aa7618a85eebc33e2eed99ec2dfb27e
Former-commit-id: 1aba866
  • Loading branch information
ToTheBeginning committed Mar 16, 2023
1 parent 92273bf commit 36e8a91
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# ignored folders
tmp/*

# ignore images in examples folder
examples/*/*

*.DS_Store
.idea

Expand Down
48 changes: 48 additions & 0 deletions examples/download_examples.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import os
from tqdm import tqdm

import torch.hub

example_list = [
'examples/canny/rabbit.png',
'examples/canny/toy_canny.png',
'examples/color/color_0000.png',
'examples/color/color_0001.png',
'examples/color/color_0002.png',
'examples/color/color_0003.png',
'examples/color/color_0004.png',
'examples/depth/desk_depth.png',
'examples/depth/sd.png',
'examples/edit_cat/edge.png',
'examples/edit_cat/edge_2.png',
'examples/edit_cat/im.png',
'examples/edit_cat/mask.png',
'examples/keypose/iron.png',
'examples/keypose/person_keypose.png',
'examples/openpose/iron_man_image.png',
'examples/openpose/iron_man_pose.png',
'examples/seg/dinner.png',
'examples/seg/motor.png',
'examples/seg_sketch/edge.png',
'examples/seg_sketch/mask.png',
'examples/sketch/car.png',
'examples/sketch/girl.jpeg',
'examples/sketch/human.png',
'examples/sketch/scenery.jpg',
'examples/sketch/scenery2.jpg',
'examples/style/Bianjing_city_gate.jpeg',
'examples/style/Claude_Monet,_Impression,_soleil_levant,_1872.jpeg',
'examples/style/DVwG-hevauxk1601457.jpeg',
'examples/style/The_Persistence_of_Memory.jpeg',
'examples/style/Tsunami_by_hokusai_19th_century.jpeg',
'examples/style/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpeg',
'examples/style/cyberpunk.png',
'examples/style/scream.jpeg'
]

huggingface_root = 'https://huggingface.co/TencentARC/T2I-Adapter/resolve/main'

for example_path in tqdm(example_list):
if not os.path.exists(example_path):
os.makedirs(os.path.dirname(example_path), exist_ok=True)
torch.hub.download_url_to_file(f'{huggingface_root}/{example_path}', example_path)
Empty file removed experiments/README.md
Empty file.
5 changes: 5 additions & 0 deletions models/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
You can manually download the models from
- [T2I-Adapter v1](https://huggingface.co/TencentARC/T2I-Adapter/tree/main/models)
- [third-party-models](https://huggingface.co/TencentARC/T2I-Adapter/tree/main/third-party-models)

and put them into `models` folder

0 comments on commit 36e8a91

Please sign in to comment.