Spaces:
Sleeping
Sleeping
actualizando el app
Browse files
app.py
CHANGED
@@ -61,15 +61,11 @@ def load():
|
|
61 |
path_images = 'data/doc_explore/DocExplore_images/'
|
62 |
path_model = hf_hub_download(repo_id="CHSTR/DocExplore", filename="epoch=16-mAP=0.66_triplet.ckpt")#"models/epoch=16-mAP=0.66_triplet.ckpt"
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
print("Modelo cargado exitosamente")
|
70 |
-
except:
|
71 |
-
print("No se pudo cargar el modelo. Intenta nuevamente cambiando el argumento --model_type")
|
72 |
-
exit()
|
73 |
|
74 |
embeddings_file_1 = hf_hub_download(repo_id="CHSTR/DocExplore", filename="dino_flicker_docexplore_groundingDINO.pkl")
|
75 |
embeddings_file_0 = hf_hub_download(repo_id="CHSTR/DocExplore", filename="docexp_embeddings.pkl")
|
|
|
61 |
path_images = 'data/doc_explore/DocExplore_images/'
|
62 |
path_model = hf_hub_download(repo_id="CHSTR/DocExplore", filename="epoch=16-mAP=0.66_triplet.ckpt")#"models/epoch=16-mAP=0.66_triplet.ckpt"
|
63 |
|
64 |
+
|
65 |
+
model_checkpoint = torch.load(path_model) # 'model_60k_images_073.ckpt' -> modelo entrenado con 60k imagenes sin pidinet
|
66 |
+
model.load_state_dict(model_checkpoint['state_dict']) # 'modified_model_083.ckpt' -> modelo entrenado con 60k imagenes con pidinet
|
67 |
+
model.eval() # 'original_model_083.ckpt' -> modelo original entrenado con 60k imagenes con pidinet
|
68 |
+
print("Modelo cargado exitosamente")
|
|
|
|
|
|
|
|
|
69 |
|
70 |
embeddings_file_1 = hf_hub_download(repo_id="CHSTR/DocExplore", filename="dino_flicker_docexplore_groundingDINO.pkl")
|
71 |
embeddings_file_0 = hf_hub_download(repo_id="CHSTR/DocExplore", filename="docexp_embeddings.pkl")
|