8.1.1.9.1.1.1.2. blueoil.utils.predict_output.writer

8.1.1.9.1.1.1.2.1. Module Contents

8.1.1.9.1.1.1.2.1.1. Classes

OutputWriter

8.1.1.9.1.1.1.2.1.2. Functions

save_npy(dest, outputs, step)

Save numpy array to disk.

save_json(dest, json, step)

Save JSON to disk.

save_materials(dest, materials, step)

Save materials to disk.

blueoil.utils.predict_output.writer.logger
class blueoil.utils.predict_output.writer.OutputWriter(task, classes, image_size, data_format)
write(self, dest, outputs, raw_images, image_files, step, save_material=True)
Save predict output to disk.

numpy array, JSON, and images if you want.

Parameters
  • dest (str) – path to save file

  • outputs (np.ndarray) – save ndarray

  • raw_images (np.ndarray) – image ndarray

  • image_files (list[str]) – list of file names.

  • step (int) – value of training step

  • save_material (bool, optional) – save materials or not. Defaults to True.

blueoil.utils.predict_output.writer.save_npy(dest, outputs, step)

Save numpy array to disk.

Parameters
  • dest (str) – path to save file

  • outputs (np.ndarray) – save ndarray

  • step (int) – value of training step

Raises
  • PermissionError – If dest dir has no permission to write.

  • ValueError – If type of step is not int.

blueoil.utils.predict_output.writer.save_json(dest, json, step)

Save JSON to disk.

Parameters
  • dest (str) – path to save file

  • json (str) – dumped json string

  • step (int) – value of training step

Raises
  • PermissionError – If dest dir has no permission to write.

  • ValueError – If type of step is not int.

blueoil.utils.predict_output.writer.save_materials(dest, materials, step)

Save materials to disk.

Parameters
  • dest (str) – path to save file

  • materials (list[(str, PIL.Image)]) – image data, str in tuple is filename.

  • step (int) – value of training step

Raises
  • PermissionError – If dest dir has no permission to write.

  • ValueError – If type of step is not int.