Skip to content

Commit

Permalink
fix: use isinstace over type comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
furiosamg committed Aug 9, 2023
1 parent b8c645d commit b58c4c9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion furiosa/models/vision/resnet50/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __call__(
"""
# https://github.com/mlcommons/inference/blob/af7f5a0b856402b9f461002cfcad116736a8f8af/vision/classification_and_detection/python/main.py#L37-L39
# https://github.com/mlcommons/inference/blob/af7f5a0b856402b9f461002cfcad116736a8f8af/vision/classification_and_detection/python/dataset.py#L168-L184
if type(image) == str:
if isinstance(image, str):
image = cv2.imread(image)
if image is None:
raise FileNotFoundError(image)
Expand Down
2 changes: 1 addition & 1 deletion furiosa/models/vision/ssd_mobilenet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def __call__(
if isinstance(images, str):
images = [images]
for image in images:
if type(image) == str:
if isinstance(image, str):
image = cv2.imread(image)
if image is None:
raise FileNotFoundError(image)
Expand Down
2 changes: 1 addition & 1 deletion furiosa/models/vision/ssd_resnet34/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def __call__(
if isinstance(images, str):
images = [images]
for image in images:
if type(image) == str:
if isinstance(image, str):
image = cv2.imread(image)
if image is None:
raise FileNotFoundError(image)
Expand Down
2 changes: 1 addition & 1 deletion furiosa/models/vision/yolov5/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def __call__(
if isinstance(images, str):
images = [images]
for img in images:
if type(img) == str:
if isinstance(img, str):
img = cv2.imread(img)
if img is None:
raise FileNotFoundError(img)
Expand Down

0 comments on commit b58c4c9

Please sign in to comment.