Testing detect

This commit is contained in:
2025-12-19 10:44:11 +02:00
parent 6ae7481e25
commit 8f8132ce61
2 changed files with 9 additions and 3 deletions

View File

@@ -196,7 +196,7 @@ class YOLOWrapper:
f"Running inference on {source} -> prepared_source {prepared_source}" f"Running inference on {source} -> prepared_source {prepared_source}"
) )
results = self.model.predict( results = self.model.predict(
source=prepared_source, source=source,
conf=conf, conf=conf,
iou=iou, iou=iou,
save=save, save=save,

View File

@@ -129,8 +129,13 @@ class Image:
# Extract metadata # Extract metadata
print(self._data.shape) print(self._data.shape)
if len(self._data.shape) == 2:
self._height, self._width = self._data.shape[:2] self._height, self._width = self._data.shape[:2]
self._channels = self._data.shape[2] if len(self._data.shape) == 3 else 1 self._channels = 1
else:
self._height, self._width = self._data.shape[1:]
self._channels = self._data.shape[0]
# self._channels = self._data.shape[2] if len(self._data.shape) == 3 else 1
self._format = self.path.suffix.lower().lstrip(".") self._format = self.path.suffix.lower().lstrip(".")
self._size_bytes = self.path.stat().st_size self._size_bytes = self.path.stat().st_size
self._dtype = self._data.dtype self._dtype = self._data.dtype
@@ -317,6 +322,7 @@ class Image:
if self.channels == 1: if self.channels == 1:
if pseudo_rgb: if pseudo_rgb:
img = get_pseudo_rgb(self.data) img = get_pseudo_rgb(self.data)
print("Image.save", img.shape)
else: else:
img = np.repeat(self.data, 3, axis=2) img = np.repeat(self.data, 3, axis=2)