Skip to content

Commit

Permalink
bump nodelib and adapt to breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
denniswittich committed Nov 13, 2024
1 parent 226c712 commit e820f82
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions detector/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ fi

# ========================== BUILD CONFIGURATION / IMAGE SELECTION =======================

SEMANTIC_VERSION=0.1.7
NODE_LIB_VERSION=0.10.17
SEMANTIC_VERSION=0.1.8
NODE_LIB_VERSION=0.11.0
build_args=" --build-arg NODE_LIB_VERSION=$NODE_LIB_VERSION"

if [ -f /etc/nv_tegra_release ] # Check if we are on a Jetson device
Expand Down
12 changes: 6 additions & 6 deletions detector/yolov5_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import cv2
import numpy as np
from learning_loop_node.data_classes import (BoxDetection, CategoryType,
Detections, PointDetection)
ImageMetadata, PointDetection)
from learning_loop_node.detector.detector_logic import DetectorLogic

import yolov5
Expand Down Expand Up @@ -63,9 +63,9 @@ def clip_point(x: float, y: float, img_width: int, img_height: int) -> Tuple[flo
y = min(max(0, y), img_height)
return x, y

def evaluate(self, image: np.ndarray) -> Detections:
def evaluate(self, image: np.ndarray) -> ImageMetadata:
assert self.yolov5 is not None, 'init() must be executed first. Maybe loading the engine failed?!'
detections = Detections()
image_metadata = ImageMetadata()
try:
t = time.time()
cv_image = cv2.imdecode(image, cv2.IMREAD_COLOR)
Expand All @@ -81,7 +81,7 @@ def evaluate(self, image: np.ndarray) -> Detections:
continue
if category.type == CategoryType.Box:
x, y, w, h = self.clip_box(x, y, w, h, im_width, im_height)
detections.box_detections.append(
image_metadata.box_detections.append(
BoxDetection(category_name=category.name,
x=round(x),
y=round(y),
Expand All @@ -93,7 +93,7 @@ def evaluate(self, image: np.ndarray) -> Detections:
elif category.type == CategoryType.Point:
cx, cy = x + w/2, y + h/2
cx, cy = self.clip_point(cx, cy, im_width, im_height)
detections.point_detections.append(
image_metadata.point_detections.append(
PointDetection(category_name=category.name,
x=cx,
y=cy,
Expand All @@ -106,7 +106,7 @@ def evaluate(self, image: np.ndarray) -> Detections:
f'Removed {len(skipped_detections)} small detections from result: \n{log_msg}')
except Exception:
self.log.exception('inference failed')
return detections
return image_metadata

def _create_engine(self, resolution: int, cat_count: int, wts_file: str) -> str:
engine_file = os.path.dirname(wts_file) + '/model.engine'
Expand Down
4 changes: 2 additions & 2 deletions trainer/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ fi
# NODE_LIB_VERSION should only be used, to build the corresponding version and deploy to docker
# make sure the remote repository always has the 'latest' tag (otherwise the CI tests will fail)

SEMANTIC_VERSION=0.1.7
NODE_LIB_VERSION=0.10.16
SEMANTIC_VERSION=0.1.8
NODE_LIB_VERSION=0.11.0

#image="zauberzeug/yolov5-trainer:$SEMANTIC_VERSION-nlv$NODE_LIB_VERSION"
image="zauberzeug/yolov5-trainer:latest"
Expand Down

0 comments on commit e820f82

Please sign in to comment.