Skip to content

Commit 5e229f5

Browse files
author
spencer@primus
committed
Update makefile for install without extras
1 parent 2d14190 commit 5e229f5

3 files changed

Lines changed: 27 additions & 11 deletions

File tree

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ help:
1919
install: $(INSTALL_STAMP)
2020
$(INSTALL_STAMP): pyproject.toml poetry.lock
2121
@if [ -z $(POETRY) ]; then echo "Poetry could not be found. See https://python-poetry.org/docs/"; exit 2; fi
22-
$(POETRY) install --all-extras
22+
# $(POETRY) install --all-extras
23+
$(POETRY) install
2324
touch $(INSTALL_STAMP)
2425

2526
.PHONY: clean

avapi/carla/dataset.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,13 @@ class CarlaScenesManager(BaseSceneManager):
6868
nominal_whitelist_types = _nominal_whitelist_types
6969
nominal_ignore_types = _nominal_ignore_types
7070

71-
def __init__(self, data_dir, verbose=False,
72-
split_fracs = {"train": 0.6, "val": 0.2, "test": 0.2}, seed: int = 1):
71+
def __init__(
72+
self,
73+
data_dir,
74+
verbose=False,
75+
split_fracs={"train": 0.6, "val": 0.2, "test": 0.2},
76+
seed: int = 1,
77+
):
7378
"""
7479
data_dir: the base folder where all scenes are kept
7580
"""

avapi/visualize/snapshot.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def show_image(img, extent=None, axis=False, inline=True, grayscale=False):
3636
if inline:
3737
pil_im = Image.fromarray(img)
3838
plt.figure(figsize=[2 * x for x in plt.rcParams["figure.figsize"]])
39-
img_plot = plt.imshow(pil_im, extent=extent, cmap=("gray" if grayscale else None))
39+
img_plot = plt.imshow(
40+
pil_im, extent=extent, cmap=("gray" if grayscale else None)
41+
)
4042
if not axis:
4143
plt.axis("off")
4244
plt.show()
@@ -292,7 +294,7 @@ def show_image_with_boxes(
292294
if isinstance(box, Box2D) or (
293295
isinstance(box, (ObjectState, BoxDetection, MaskDetection, BasicBoxTrack2D))
294296
and isinstance(box.box, Box2D)
295-
):
297+
):
296298
if isinstance(
297299
box, (ObjectState, BoxDetection, MaskDetection, BasicBoxTrack2D)
298300
):
@@ -310,9 +312,17 @@ def show_image_with_boxes(
310312
bl_edge = (box.xmin, box.ymin)
311313
# add text
312314
if text is not None:
313-
add_text_to_image(img1, bl_edge, text[i], fontscale=fontscale, font_thickness=font_thickness)
315+
add_text_to_image(
316+
img1,
317+
bl_edge,
318+
text[i],
319+
fontscale=fontscale,
320+
font_thickness=font_thickness,
321+
)
314322
# add id
315-
add_text_to_image(img1, bl_edge, ID, fontscale=fontscale, font_thickness=font_thickness)
323+
add_text_to_image(
324+
img1, bl_edge, ID, fontscale=fontscale, font_thickness=font_thickness
325+
)
316326
elif (
317327
isinstance(box, (Box3D, BasicBoxTrack3D))
318328
or (
@@ -480,7 +490,7 @@ def show_lidar_bev_with_boxes(
480490
extent_max = [
481491
(min(pc[:, 0]), max(pc[:, 1])),
482492
(min(pc[:, 1]), max(pc[:, 1])),
483-
(min(pc[:, 2]), max(pc[:, 2]))
493+
(min(pc[:, 2]), max(pc[:, 2])),
484494
]
485495
extent_use = []
486496
for ex, ex_max in zip(extent, extent_max):
@@ -550,7 +560,7 @@ def show_lidar_bev_with_boxes(
550560
img1 = 255 * np.ones([bev_size[0], bev_size[1], 3], dtype=np.uint8)
551561
else:
552562
raise NotImplementedError(background_color)
553-
563+
554564
# get scaling
555565
if extent_use is None:
556566
width_scale = (max_width - min_width) / bev_size[0]
@@ -691,8 +701,8 @@ def plot_line(img1, line, line_color):
691701
if return_image:
692702
if scale_return_image:
693703
scale_ratio = width_scale / range_scale
694-
dx = bev_size[0]*scale_ratio if scale_ratio > 1 else bev_size[0]
695-
dy = bev_size[1]/scale_ratio if scale_ratio < 1 else bev_size[1]
704+
dx = bev_size[0] * scale_ratio if scale_ratio > 1 else bev_size[0]
705+
dy = bev_size[1] / scale_ratio if scale_ratio < 1 else bev_size[1]
696706
new_size = (int(dx), int(dy))
697707
return cv2.resize(img1, new_size)
698708
else:

0 commit comments

Comments
 (0)