Skip to content

Commit

Permalink
style: [CI] format
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Actions Bot committed Apr 16, 2024
1 parent c95a709 commit 8fc95a8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
4 changes: 3 additions & 1 deletion spatialyze/video_processor/stages/depth_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ def eval_all(self, input_images: "list[npt.NDArray | None]"):
# Load image and preprocess
input_image = pil.fromarray(im[:, :, [2, 1, 0]])
original_width, original_height = input_image.size
input_image = input_image.resize((self.feed_width, self.feed_height), pil.Resampling.LANCZOS)
input_image = input_image.resize(
(self.feed_width, self.feed_height), pil.Resampling.LANCZOS
)
input_image = transforms.ToTensor()(input_image).unsqueeze(0)

# PREDICTION
Expand Down
12 changes: 7 additions & 5 deletions spatialyze/video_processor/stages/detection_2d/ground_truth.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,12 @@ def _run(self, payload: "Payload"):
if len(tensor) == 0:
metadata.append(Metadatum(torch.Tensor([]), yolo_classes, []))
else:
metadata.append(Metadatum(
torch.Tensor(tensor),
yolo_classes,
[DetectionId(i, _id) for _id in ids],
))
metadata.append(
Metadatum(
torch.Tensor(tensor),
yolo_classes,
[DetectionId(i, _id) for _id in ids],
)
)

return None, {self.classname(): metadata}
12 changes: 7 additions & 5 deletions spatialyze/video_processor/stages/detection_3d/ground_truth.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ def _run(self, payload: "Payload"):
if len(tensor) == 0:
metadata.append(Metadatum(torch.Tensor([]), yolo_classes, []))
else:
metadata.append(Metadatum(
torch.Tensor(tensor),
yolo_classes,
[DetectionId(i, _id) for _id in ids],
))
metadata.append(
Metadatum(
torch.Tensor(tensor),
yolo_classes,
[DetectionId(i, _id) for _id in ids],
)
)

return None, {self.classname(): metadata}

0 comments on commit 8fc95a8

Please sign in to comment.