diff --git a/scripts/upload_resource.py b/scripts/upload_resource.py index e5e91ebf..18479a80 100644 --- a/scripts/upload_resource.py +++ b/scripts/upload_resource.py @@ -31,11 +31,6 @@ yaml = YAML(typ="safe") logger = logging.getLogger(__name__) -# COLLECTION_URL = "https://raw.githubusercontent.com/bioimage-io/collection-bioimage-io/gh-pages/collection.json" -COLLECTION_URL = "https://raw.githubusercontent.com/bioimage-io/collection-bioimage-io/bd814413906ad105e8732a50b51a954aae25771b/collection.json" -COLLECTION_SHA256 = "44d3bdc9120139f864a76da8669c7ad8d77fd4c09b66fb4319db826326691614" -UPLOAD_URL = "https://oc.embl.de/index.php/s/mdE3in0099rQFwW" - COLLECTION_FOLDER = ( Path(__file__).parent.parent.parent / "collection-bioimage-io/collection" ) @@ -122,19 +117,6 @@ def upload_resources( print(f"uploaded {upload_count}") -def get_model_urls_from_collection_json(): - collection_path = Path(pooch.retrieve(COLLECTION_URL, known_hash=COLLECTION_SHA256)) # type: ignore - - with collection_path.open() as f: - collection = json.load(f) - - return [ - entry["rdf_source"] - for entry in collection["collection"] - if entry["type"] == "model" - ] - - def get_model_urls_from_collection_folder(start: int = 0, end: int = 9999): assert COLLECTION_FOLDER.exists() ret: List[Tuple[BioimageioYamlContent, RootHttpUrl]] = [] @@ -201,7 +183,7 @@ def get_model_urls_from_collection_folder(start: int = 0, end: int = 9999): return ret -UPLOADED = { +UPLOADED_SANDBOX = { "funny-butterfly_v1.zip", "committed-turkey_v1.zip", "pioneering-goat_v1.zip", @@ -256,7 +238,8 @@ def get_model_urls_from_collection_folder(start: int = 0, end: int = 9999): "determined-hedgehog_v1.zip", } +UPLOADED = {} + if __name__ == "__main__": - # model_urls = get_model_urls_from_collection_json() model_urls = get_model_urls_from_collection_folder(start=0) upload_resources(model_urls)