Skip to content

Commit

Permalink
Merge pull request #8 from opendilab/gl-dev
Browse files Browse the repository at this point in the history
Fix code format
  • Loading branch information
RobinC94 authored Nov 1, 2021
2 parents 586c956 + cb71071 commit eb93609
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 162 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -1405,3 +1405,6 @@ htmlcov
project_test.py
*.csv
*.avi
*episode_metainfo.json
*measurements.lmdb
*index.txt
11 changes: 11 additions & 0 deletions .style.yapf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[style]
# For explanation and more information: https://github.com/google/yapf
BASED_ON_STYLE=pep8
DEDENT_CLOSING_BRACKETS=True
SPLIT_BEFORE_FIRST_ARGUMENT=True
ALLOW_SPLIT_BEFORE_DICT_VALUE=False
JOIN_MULTIPLE_LINES=False
COLUMN_LIMIT=120
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF=True
BLANK_LINES_AROUND_TOP_LEVEL_DEFINITION=2
SPACES_AROUND_POWER_OPERATOR=True
152 changes: 0 additions & 152 deletions core/data/dataset_saver.py

This file was deleted.

14 changes: 5 additions & 9 deletions core/data/lbc_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from core.utils.others.image_helper import read_image, draw_msra_gaussian
from core.utils.data_utils import augmenter


PIXEL_OFFSET = 10
PIXELS_PER_METER = 5

Expand Down Expand Up @@ -160,12 +159,7 @@ def __getitem__(self, index) -> Any:
regression_offset[i] = center - center_int
indices[i] = center_int[1] * output_size + center_int[0]

return {
'birdview': birdview,
'location': np.array(locations),
'command': command,
'speed': speed
}
return {'birdview': birdview, 'location': np.array(locations), 'command': command, 'speed': speed}


class LBCImageDataset(Dataset):
Expand Down Expand Up @@ -196,7 +190,7 @@ def __init__(
self._batch_read_number = batch_read_number
self._batch_aug = batch_aug

print ("augment with ", augment_strategy)
print("augment with ", augment_strategy)
if augment_strategy is not None and augment_strategy != 'None':
self.augmenter = getattr(augmenter, augment_strategy)
else:
Expand Down Expand Up @@ -240,7 +234,9 @@ def __getitem__(self, index) -> Any:
rgb_image = read_image(png_file).reshape(160, 384, 3)

if self.augmenter:
rgb_images = [self.augmenter(self._batch_read_number).augment_image(rgb_image) for i in range(self._batch_aug)]
rgb_images = [
self.augmenter(self._batch_read_number).augment_image(rgb_image) for i in range(self._batch_aug)
]
else:
rgb_images = [rgb_image for i in range(self._batch_aug)]

Expand Down
2 changes: 1 addition & 1 deletion core/policy/lbc_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LBCBirdviewPolicy(BaseCarlaPolicy):
config = dict(
cuda=True,
model=dict(),
learn=dict(loss='l1',),
learn=dict(loss='l1', ),
steer_points=None,
pid=None,
gap=5,
Expand Down
3 changes: 3 additions & 0 deletions demo/cict/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
_logs
_preloads
vis
Binary file removed docs/figs/image-cils_1.png
Binary file not shown.

0 comments on commit eb93609

Please sign in to comment.