gabar92 commited on
Commit
04f8aab
·
1 Parent(s): cebc308

load example images from the same space

Browse files
Files changed (1) hide show
  1. app.py +9 -23
app.py CHANGED
@@ -90,33 +90,19 @@ def main():
90
 
91
  die_token = os.getenv("DIE_TOKEN")
92
 
93
- # Load example images from the private repository
94
- example_image_list = []
95
- example_images = [
96
- "_002.jpg",
97
- "_004.jpg",
98
- "_005.jpg",
99
- "_006.jpg",
100
- "_007.jpg",
101
- "_010.jpg",
102
- "_097.jpg",
103
  ]
104
 
105
- for image_filename in example_images:
106
- image_path = hf_hub_download(
107
- repo_id="gabar92/DIE",
108
- filename=f"{args.example_image_path}/{image_filename}",
109
- use_auth_token=die_token
110
- )
111
- example_image_list.append([Image.open(image_path)])
112
 
113
  # Load DIE model
114
- # model_path = hf_hub_download(
115
- # repo_id="gabar92/DIE",
116
- # filename=args.die_model_path,
117
- # use_auth_token=die_token
118
- #)
119
- model_path = "./DIE/2024_08_09_model_epoch_89.pt"
120
  die_model = UNetDIEModel(args=args, model_path=model_path)
121
 
122
  # Partially apply the model and device arguments to die_inference
 
90
 
91
  die_token = os.getenv("DIE_TOKEN")
92
 
93
+ # Provide images alone for example display
94
+ example_image_list = [
95
+ [Image.open(os.path.join(args.example_image_path, image_path))]
96
+ for image_path in os.listdir(args.example_image_path)
 
 
 
 
 
 
97
  ]
98
 
 
 
 
 
 
 
 
99
 
100
  # Load DIE model
101
+ model_path = hf_hub_download(
102
+ repo_id="gabar92/die",
103
+ filename=args.die_model_path,
104
+ use_auth_token=die_token
105
+ )
 
106
  die_model = UNetDIEModel(args=args, model_path=model_path)
107
 
108
  # Partially apply the model and device arguments to die_inference