Skip to content

Commit eb93609

Browse files
authored
Merge pull request #8 from opendilab/gl-dev
Fix code format
2 parents 586c956 + cb71071 commit eb93609

File tree

7 files changed

+23
-162
lines changed

7 files changed

+23
-162
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,3 +1405,6 @@ htmlcov
14051405
project_test.py
14061406
*.csv
14071407
*.avi
1408+
*episode_metainfo.json
1409+
*measurements.lmdb
1410+
*index.txt

.style.yapf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[style]
2+
# For explanation and more information: https://github.com/google/yapf
3+
BASED_ON_STYLE=pep8
4+
DEDENT_CLOSING_BRACKETS=True
5+
SPLIT_BEFORE_FIRST_ARGUMENT=True
6+
ALLOW_SPLIT_BEFORE_DICT_VALUE=False
7+
JOIN_MULTIPLE_LINES=False
8+
COLUMN_LIMIT=120
9+
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF=True
10+
BLANK_LINES_AROUND_TOP_LEVEL_DEFINITION=2
11+
SPACES_AROUND_POWER_OPERATOR=True

core/data/dataset_saver.py

Lines changed: 0 additions & 152 deletions
This file was deleted.

core/data/lbc_dataset.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from core.utils.others.image_helper import read_image, draw_msra_gaussian
1111
from core.utils.data_utils import augmenter
1212

13-
1413
PIXEL_OFFSET = 10
1514
PIXELS_PER_METER = 5
1615

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

163-
return {
164-
'birdview': birdview,
165-
'location': np.array(locations),
166-
'command': command,
167-
'speed': speed
168-
}
162+
return {'birdview': birdview, 'location': np.array(locations), 'command': command, 'speed': speed}
169163

170164

171165
class LBCImageDataset(Dataset):
@@ -196,7 +190,7 @@ def __init__(
196190
self._batch_read_number = batch_read_number
197191
self._batch_aug = batch_aug
198192

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

242236
if self.augmenter:
243-
rgb_images = [self.augmenter(self._batch_read_number).augment_image(rgb_image) for i in range(self._batch_aug)]
237+
rgb_images = [
238+
self.augmenter(self._batch_read_number).augment_image(rgb_image) for i in range(self._batch_aug)
239+
]
244240
else:
245241
rgb_images = [rgb_image for i in range(self._batch_aug)]
246242

core/policy/lbc_policy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class LBCBirdviewPolicy(BaseCarlaPolicy):
3636
config = dict(
3737
cuda=True,
3838
model=dict(),
39-
learn=dict(loss='l1',),
39+
learn=dict(loss='l1', ),
4040
steer_points=None,
4141
pid=None,
4242
gap=5,

demo/cict/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_logs
2+
_preloads
3+
vis

docs/figs/image-cils_1.png

-15.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)