Skip to content

Commit

Permalink
[Fix]: fix image conversion of Waymo to avoid information loss (#1979)
Browse files Browse the repository at this point in the history
  • Loading branch information
JingweiZhang12 authored Nov 3, 2022
1 parent 7249eb4 commit a5bb2cd
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 a5bb2cd

Please # to comment.