Skip to content

Commit

Permalink
update mmseg and mmdet configs according to the installed versions
Browse files Browse the repository at this point in the history
  • Loading branch information
potipot committed Oct 2, 2023
1 parent f2b979a commit 728c985
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions icevision/models/mmdet/download_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from icevision.imports import *
from icevision.utils import *

VERSION = "v2.20.1"
VERSION = "v2.25.0"
BASE_URL = "https://github.com/airctic/mmdetection_configs/archive/refs/tags"


Expand All @@ -15,7 +15,7 @@ def download_mmdet_configs() -> Path:

if mmdet_config_path.exists():
logger.info(
f"The mmdet config folder already exists. No need to downloaded it. Path : {mmdet_config_path}"
f"The mmdet config folder already exists. No need to download it. Path : {mmdet_config_path}"
)
elif download_path.exists():
# The zip file was downloaded by not extracted yet
Expand Down
16 changes: 7 additions & 9 deletions icevision/models/mmseg/download_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,32 @@
from icevision.imports import *
from icevision.utils import *

# VERSION = "v2.10.0" # TODO: Update
VERSION = "v0.17.0"
BASE_URL = "https://codeload.github.com/Orbis-International/mmsegmentation_configs/zip/refs/tags"
VERSION = "0.29.1"
BASE_URL = f"https://github.com/potipot/icevision/releases/download/0.13.0/mmsegmentation_configs-{VERSION}.zip"


def download_mmseg_configs() -> Path:

save_dir = get_root_dir() / f"mmsegmentation_configs"

mmseg_config_path = save_dir / f"mmsegmentation_configs-{VERSION[1:]}/configs"
download_path = save_dir / f"{VERSION}.zip"
mmseg_config_path = save_dir / Path(BASE_URL).stem / "configs"
download_path = save_dir / f"{Path(BASE_URL).stem}.zip"

if mmseg_config_path.exists():
logger.info(
f"The mmseg config folder already exists. No need to downloaded it. Path : {mmseg_config_path}"
f"The mmseg config folder already exists. No need to download it. Path : {mmseg_config_path}"
)
elif download_path.exists():
# The zip file was downloaded by not extracted yet
# Extract zip file
logger.info(f"Extracting the {VERSION}.zip file.")
logger.info(f"Extracting the {download_path.name} file.")

Check warning on line 24 in icevision/models/mmseg/download_configs.py

View check run for this annotation

Codecov / codecov/patch

icevision/models/mmseg/download_configs.py#L24

Added line #L24 was not covered by tests
save_dir = Path(download_path).parent
shutil.unpack_archive(filename=str(download_path), extract_dir=str(save_dir))
else:
save_dir.mkdir(parents=True, exist_ok=True)

download_path = save_dir / f"{VERSION}.zip"
if not download_path.exists():
logger.info("Downloading mmseg configs")
download_and_extract(f"{BASE_URL}/{VERSION}", download_path)
download_and_extract(BASE_URL, download_path)

return mmseg_config_path

0 comments on commit 728c985

Please sign in to comment.