Skip to content

Commit

Permalink
[Fix]: fix image conversion of Waymo to avoid information loss (open-…
Browse files Browse the repository at this point in the history
  • Loading branch information
JingweiZhang12 authored and ZwwWayne committed Dec 3, 2022
1 parent 1187eef commit 4d5a7fe
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tools/dataset_converters/waymo_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from glob import glob
from os.path import join

import mmcv
import mmengine
import numpy as np
import tensorflow as tf
Expand Down Expand Up @@ -162,8 +161,8 @@ def save_image(self, frame, file_idx, frame_idx):
img_path = f'{self.image_save_dir}{str(img.name - 1)}/' + \
f'{self.prefix}{str(file_idx).zfill(3)}' + \
f'{str(frame_idx).zfill(3)}.jpg'
img = mmcv.imfrombytes(img.image)
mmcv.imwrite(img, img_path)
with open(img_path, 'wb') as fp:
fp.write(img.image)

def save_calib(self, frame, file_idx, frame_idx):
"""Parse and save the calibration data.
Expand Down

0 comments on commit 4d5a7fe

Please # to comment.