Skip to content

Commit

Permalink
fix redundant usage of Path object
Browse files Browse the repository at this point in the history
  • Loading branch information
yunchu committed Jun 4, 2024
1 parent e7d8ae5 commit b719ffe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/otx/algo/classification/dino_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(

if ci_data_root is not None and Path(ci_data_root).exists():
ckpt_filename = f"{backbone}4_pretrain.pth"
ckpt_path = Path(Path(ci_data_root) / "torch" / "hub" / "checkpoints" / ckpt_filename)
ckpt_path = Path(ci_data_root) / "torch" / "hub" / "checkpoints" / ckpt_filename
if not ckpt_path.exists():
msg = f"cannot find weights file: {ckpt_filename}"
raise FileExistsError(msg)
Expand Down
2 changes: 1 addition & 1 deletion src/otx/algo/segmentation/backbones/dinov2.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(

if ci_data_root is not None and Path(ci_data_root).exists():
ckpt_filename = f"{name}4_pretrain.pth"
ckpt_path = Path(Path(ci_data_root) / "torch" / "hub" / "checkpoints" / ckpt_filename)
ckpt_path = Path(ci_data_root) / "torch" / "hub" / "checkpoints" / ckpt_filename
if not ckpt_path.exists():
msg = f"cannot find weights file: {ckpt_filename}"
raise FileExistsError(msg)
Expand Down

0 comments on commit b719ffe

Please sign in to comment.