Spaces:
Runtime error
Runtime error
privatize weights
Browse files
app.py
CHANGED
|
@@ -183,13 +183,14 @@ class HandDiffOpts:
|
|
| 183 |
n_val_samples: int = 4
|
| 184 |
|
| 185 |
# load models
|
|
|
|
| 186 |
if NEW_MODEL:
|
| 187 |
opts = HandDiffOpts()
|
| 188 |
if MODEL_EPOCH == 7:
|
| 189 |
model_path = './DINO_EMA_11M_b50_lr1e-5_epoch7_step380k.ckpt'
|
| 190 |
elif MODEL_EPOCH == 6:
|
| 191 |
# model_path = "./DINO_EMA_11M_b50_lr1e-5_epoch6_step320k.ckpt"
|
| 192 |
-
model_path = hf_hub_download(repo_id="Chaerin5/FoundHand-weights", filename="DINO_EMA_11M_b50_lr1e-5_epoch6_step320k.ckpt")
|
| 193 |
elif MODEL_EPOCH == 4:
|
| 194 |
model_path = "./DINO_EMA_11M_b50_lr1e-5_epoch4_step210k.ckpt"
|
| 195 |
elif MODEL_EPOCH == 10:
|
|
@@ -239,7 +240,7 @@ else:
|
|
| 239 |
missing_keys, extra_keys = autoencoder.load_state_dict(vae_state_dict, strict=False)
|
| 240 |
autoencoder.eval()
|
| 241 |
assert len(missing_keys) == 0 and len(extra_keys) == 0
|
| 242 |
-
sam_path = hf_hub_download(repo_id="Chaerin5/FoundHand-weights", filename="sam_vit_h_4b8939.pth")
|
| 243 |
sam_predictor = init_sam(ckpt_path=sam_path, device=device)
|
| 244 |
|
| 245 |
|
|
|
|
| 183 |
n_val_samples: int = 4
|
| 184 |
|
| 185 |
# load models
|
| 186 |
+
token = os.getenv("HF_TOKEN")
|
| 187 |
if NEW_MODEL:
|
| 188 |
opts = HandDiffOpts()
|
| 189 |
if MODEL_EPOCH == 7:
|
| 190 |
model_path = './DINO_EMA_11M_b50_lr1e-5_epoch7_step380k.ckpt'
|
| 191 |
elif MODEL_EPOCH == 6:
|
| 192 |
# model_path = "./DINO_EMA_11M_b50_lr1e-5_epoch6_step320k.ckpt"
|
| 193 |
+
model_path = hf_hub_download(repo_id="Chaerin5/FoundHand-weights", filename="DINO_EMA_11M_b50_lr1e-5_epoch6_step320k.ckpt", token=token)
|
| 194 |
elif MODEL_EPOCH == 4:
|
| 195 |
model_path = "./DINO_EMA_11M_b50_lr1e-5_epoch4_step210k.ckpt"
|
| 196 |
elif MODEL_EPOCH == 10:
|
|
|
|
| 240 |
missing_keys, extra_keys = autoencoder.load_state_dict(vae_state_dict, strict=False)
|
| 241 |
autoencoder.eval()
|
| 242 |
assert len(missing_keys) == 0 and len(extra_keys) == 0
|
| 243 |
+
sam_path = hf_hub_download(repo_id="Chaerin5/FoundHand-weights", filename="sam_vit_h_4b8939.pth", token=token)
|
| 244 |
sam_predictor = init_sam(ckpt_path=sam_path, device=device)
|
| 245 |
|
| 246 |
|