Colour channels were already swapped

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2019-08-07 13:45:02 +02:00
parent b123e90821
commit 49490aa05b
2 changed files with 0 additions and 3 deletions

View File

@ -475,7 +475,6 @@ def load_scenenet_data(photo_paths: Sequence[Sequence[str]],
else: else:
transformations = [ transformations = [
object_detection_2d_photometric_ops.ConvertTo3Channels(), object_detection_2d_photometric_ops.ConvertTo3Channels(),
object_detection_2d_photometric_ops.ConvertColor(current='RGB', to='BGR'),
object_detection_2d_geometric_ops.Resize(height=resized_shape[0], object_detection_2d_geometric_ops.Resize(height=resized_shape[0],
width=resized_shape[1]) width=resized_shape[1])
] ]

View File

@ -65,8 +65,6 @@ def save_ssd_train_images(images: Union[np.ndarray, Sequence[str]], labels: np.n
if type(train_image) is str: if type(train_image) is str:
with Image.open(train_image) as _image: with Image.open(train_image) as _image:
train_image = np.array(_image, dtype=np.uint8) train_image = np.array(_image, dtype=np.uint8)
else:
train_image = cv2.cvtColor(train_image, cv2.COLOR_BGR2RGB)
image = Image.fromarray(train_image) image = Image.fromarray(train_image)
image.save(f"{output_path}/" image.save(f"{output_path}/"
f"{custom_string}train_image{str(i).zfill(nr_digits)}.png") f"{custom_string}train_image{str(i).zfill(nr_digits)}.png")