Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ROS1 bridge type conversion bug #300

Merged
merged 3 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def to_ros_bounding_box_list(self, bounding_box_list):
detection.bbox.center.y = bounding_box.top + bounding_box.height / 2.0
detection.bbox.size_x = bounding_box.width
detection.bbox.size_y = bounding_box.height
detection.results[0].id = bounding_box.name
detection.results[0].id = int(bounding_box.name)
detection.results[0].score = bounding_box.confidence
detections.detections.append(detection)
return detections
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,21 +572,35 @@ def download(self, path=None, mode="pretrained", verbose=False,
"yolo_voc.json")
if verbose:
print("Downloading metadata...")
urlretrieve(file_url, os.path.join(path, "yolo_default.json"))
if not os.path.exists(os.path.join(path, "yolo_default.json")):
urlretrieve(file_url, os.path.join(path, "yolo_default.json"))
if verbose:
print("Downloaded metadata json.")
elif verbose:
print("Metadata json file already exists.")

if verbose:
print("Downloading params...")
file_url = os.path.join(url, "pretrained", "yolo_voc",
"yolo_voc.params")

urlretrieve(file_url,
os.path.join(path, "yolo_voc.params"))
if not os.path.exists(os.path.join(path, "yolo_voc.params")):
urlretrieve(file_url, os.path.join(path, "yolo_voc.params"))
if verbose:
print("Downloaded params.")
elif verbose:
print("Params file already exists.")

elif mode == "images":
file_url = os.path.join(url, "images", "cat.jpg")
if verbose:
print("Downloading example image...")
urlretrieve(file_url, os.path.join(path, "cat.jpg"))
if not os.path.exists(os.path.join(path, "cat.jpg")):
urlretrieve(file_url, os.path.join(path, "cat.jpg"))
if verbose:
print("Downloaded example image.")
elif verbose:
print("Example image already exists.")

elif mode == "test_data":
os.makedirs(os.path.join(path, "test_data"), exist_ok=True)
Expand All @@ -596,17 +610,32 @@ def download(self, path=None, mode="pretrained", verbose=False,
file_url = os.path.join(url, "test_data", "train.txt")
if verbose:
print("Downloading filelist...")
urlretrieve(file_url, os.path.join(path, "test_data", "train.txt"))
if not os.path.exists(os.path.join(path, "test_data", "train.txt")):
urlretrieve(file_url, os.path.join(path, "test_data", "train.txt"))
if verbose:
print("Downloaded filelist.")
elif verbose:
print("Filelist already exists.")
# download image
file_url = os.path.join(url, "test_data", "Images", "000040.jpg")
if verbose:
print("Downloading image...")
urlretrieve(file_url, os.path.join(path, "test_data", "Images", "000040.jpg"))
if not os.path.exists(os.path.join(path, "test_data", "Images", "000040.jpg")):
urlretrieve(file_url, os.path.join(path, "test_data", "Images", "000040.jpg"))
if verbose:
print("Downloaded image.")
elif verbose:
print("Image already exists.")
# download annotations
file_url = os.path.join(url, "test_data", "Annotations", "000040.jpg.txt")
if verbose:
print("Downloading annotations...")
urlretrieve(file_url, os.path.join(path, "test_data", "Annotations", "000040.jpg.txt"))
if not os.path.exists(os.path.join(path, "test_data", "Annotations", "000040.jpg.txt")):
urlretrieve(file_url, os.path.join(path, "test_data", "Annotations", "000040.jpg.txt"))
if verbose:
print("Downloaded annotations.")
elif verbose:
print("Annotations already exist.")

def optimize(self, target_device):
"""This method is not used in this implementation."""
Expand Down