Skip to content

Commit

Permalink
Small changes to yolo_xai and cleaning up the notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
rpytel1 committed Feb 14, 2023
1 parent 1f7c218 commit fbe2228
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion example/yolov5_exmaple/yolo_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def letterbox(

# Compute padding
ratio: Tuple[float, float] = (r, r) # width, height ratios
new_unpad: Tuple(int, int) = (int(round(shape[1] * r)), int(round(shape[0] * r)))
new_unpad: Tuple[int, int] = (int(round(shape[1] * r)), int(round(shape[0] * r)))
dw, dh = new_shape[1] - new_unpad[0], new_shape[0] - new_unpad[1] # wh padding
if auto: # minimum rectangle
dw, dh = np.mod(dw, stride), np.mod(dh, stride) # wh padding
Expand Down
2 changes: 1 addition & 1 deletion example/yolov5_exmaple/yolo_xai.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## 3. Craete model and open sample image.\n",
"## 3. Create model and open sample image.\n",
"\n",
"Downaload YOLO model from torchhub and open sample image.\n",
"Check for CUDA device availability and move the model to CUDA if available.\n",
Expand Down
3 changes: 0 additions & 3 deletions tests/test_array_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,6 @@ def test_resize_attributes() -> None:
)

assert result.shape == (4, 3)
assert result.shape != (3, 4)



def test_normalize_attributes_should_return_the_same_array_if_has_2_dimensions() -> None:
"""Test if function returns unmodified array if it has only 2 dimensions."""
Expand Down

0 comments on commit fbe2228

Please sign in to comment.