fix script
Browse files
script.py
CHANGED
@@ -446,21 +446,32 @@ if __name__ == "__main__":
|
|
446 |
MODEL_PATH = "metaformer-s-224.pth"
|
447 |
MODEL_NAME = "timm/vit_base_patch14_reg4_dinov2.lvd142m"
|
448 |
|
449 |
-
#
|
450 |
-
import zipfile
|
451 |
|
452 |
with zipfile.ZipFile("/tmp/data/private_testset.zip", 'r') as zip_ref:
|
453 |
zip_ref.extractall("/tmp/data")
|
454 |
|
455 |
-
metadata_file_path = "./
|
456 |
-
|
457 |
|
458 |
-
#
|
459 |
-
#
|
460 |
-
#
|
|
|
|
|
461 |
|
462 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
463 |
|
464 |
-
metadata_df = generate_embeddings(metadata_file_path, root_dir)
|
465 |
|
466 |
-
make_submission(metadata_df)
|
|
|
446 |
MODEL_PATH = "metaformer-s-224.pth"
|
447 |
MODEL_NAME = "timm/vit_base_patch14_reg4_dinov2.lvd142m"
|
448 |
|
449 |
+
# Real submission
|
450 |
+
# import zipfile
|
451 |
|
452 |
with zipfile.ZipFile("/tmp/data/private_testset.zip", 'r') as zip_ref:
|
453 |
zip_ref.extractall("/tmp/data")
|
454 |
|
455 |
+
# metadata_file_path = "./test_preprocessed.csv"
|
456 |
+
# test_metadata = pd.read_csv(metadata_file_path)
|
457 |
|
458 |
+
# make_submission(
|
459 |
+
# test_metadata=test_metadata,
|
460 |
+
# model_path=MODEL_PATH,
|
461 |
+
# model_name=MODEL_NAME
|
462 |
+
# )
|
463 |
|
464 |
+
# Test submission
|
465 |
+
|
466 |
+
metadata_file_path = "../trial_submission.csv"
|
467 |
+
|
468 |
+
test_metadata = pd.read_csv(metadata_file_path)
|
469 |
+
|
470 |
+
make_submission(
|
471 |
+
test_metadata=test_metadata,
|
472 |
+
model_path=MODEL_PATH,
|
473 |
+
model_name=MODEL_NAME,
|
474 |
+
images_root_path="../data/DF_FULL"
|
475 |
+
)
|
476 |
|
|
|
477 |
|
|