Skip to content

Commit

Permalink
chore: fix flake8 warnnings
Browse files Browse the repository at this point in the history
  • Loading branch information
weishan committed Jul 8, 2023
1 parent d73d090 commit c9cc454
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dinov2_retrieval/image_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import PIL
from PIL import Image, ImageOps
import torch
from torchvision import models, transforms
from torchvision import transforms
from tqdm import tqdm


Expand Down Expand Up @@ -54,7 +54,7 @@ def __init__(self, args):
sys.exit(1)
except http.client.RemoteDisconnected:
logger.error(
f"connect to github is reset. maybe set --model-path to $HOME/.cache/torch/hub/facebookresearch_dinov2_main ?"
"connect to github is reset. maybe set --model-path to $HOME/.cache/torch/hub/facebookresearch_dinov2_main ?"
)
sys.exit(1)

Expand Down Expand Up @@ -117,13 +117,13 @@ def run(self, args):
logger.debug(f"query image paths: {list(query_paths)}")

if len(query_paths) < 1:
logger.warning(f"no query image, exit")
logger.warning("no query image, exit")
return

database_img_paths = self.glob_images(Path(args.database))

if len(database_img_paths) < 1:
logger.warning(f"database does not contain images, exit")
logger.warning("database does not contain images, exit")
return

# set top_k to valid range
Expand Down

0 comments on commit c9cc454

Please sign in to comment.