Skip to content

Commit

Permalink
task one changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shivam-2507 committed Sep 18, 2024
1 parent c6275df commit 8790251
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions modules/bootcamp/detect_landing_pad.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ def run(self, image: np.ndarray) -> "tuple[list[bounding_box.BoundingBox], np.nd
# * device
# * verbose
predictions = self.__model.predict(
source=image, conf=0.25, device=self.__DEVICE, verbose=False
source=image, conf=0.7, device=self.__DEVICE, verbose=False
)

# Get the Result Object
prediction = predictions[0]

# Plot the annotated image from the Result Object
# Include the confidence value
image_annotated = prediction.plot(conf=0.7)
image_annotated = prediction.plot(boxes = True, conf = True)

# Get the xyxy boxes list from the Boxes object in the Result object
boxes_xyxy = prediction.boxes.xyxy
Expand All @@ -119,10 +119,8 @@ def run(self, image: np.ndarray) -> "tuple[list[bounding_box.BoundingBox], np.nd

# Loop over the boxes list and create a list of bounding boxes
bounding_boxes = []
for i in range(boxes_cpu.shape[0]):
x1, y1, x2, y2 = boxes_cpu[i]
bounds = np.array([x1, y1, x2, y2])
success, box = bounding_box.BoundingBox.create(bounds)
for i in range(0, boxes_cpu.shape[0]):
success, box = bounding_box.BoundingBox.create(bounds=boxes_cpu[i])
if success:
bounding_boxes.append(box)

Expand Down

0 comments on commit 8790251

Please sign in to comment.