You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.2 KiB

6 years ago
  1. syntax = "proto2";
  2. package object_detection.protos;
  3. // Configuration proto for image resizing operations.
  4. // See builders/image_resizer_builder.py for details.
  5. message ImageResizer {
  6. oneof image_resizer_oneof {
  7. KeepAspectRatioResizer keep_aspect_ratio_resizer = 1;
  8. FixedShapeResizer fixed_shape_resizer = 2;
  9. IdentityResizer identity_resizer = 3;
  10. }
  11. }
  12. // Enumeration type for image resizing methods provided in TensorFlow.
  13. enum ResizeType {
  14. BILINEAR = 0; // Corresponds to tf.image.ResizeMethod.BILINEAR
  15. NEAREST_NEIGHBOR = 1; // Corresponds to tf.image.ResizeMethod.NEAREST_NEIGHBOR
  16. BICUBIC = 2; // Corresponds to tf.image.ResizeMethod.BICUBIC
  17. AREA = 3; // Corresponds to tf.image.ResizeMethod.AREA
  18. }
  19. message IdentityResizer {
  20. }
  21. // Configuration proto for image resizer that keeps aspect ratio.
  22. message KeepAspectRatioResizer {
  23. // Desired size of the smaller image dimension in pixels.
  24. optional int32 min_dimension = 1 [default = 600];
  25. // Desired size of the larger image dimension in pixels.
  26. optional int32 max_dimension = 2 [default = 1024];
  27. // Desired method when resizing image.
  28. optional ResizeType resize_method = 3 [default = BILINEAR];
  29. // Whether to pad the image with zeros so the output spatial size is
  30. // [max_dimension, max_dimension]. Note that the zeros are padded to the
  31. // bottom and the right of the resized image.
  32. optional bool pad_to_max_dimension = 4 [default = false];
  33. // Whether to also resize the image channels from 3 to 1 (RGB to grayscale).
  34. optional bool convert_to_grayscale = 5 [default = false];
  35. // Per-channel pad value. This is only used when pad_to_max_dimension is True.
  36. // If unspecified, a default pad value of 0 is applied to all channels.
  37. repeated float per_channel_pad_value = 6;
  38. }
  39. // Configuration proto for image resizer that resizes to a fixed shape.
  40. message FixedShapeResizer {
  41. // Desired height of image in pixels.
  42. optional int32 height = 1 [default = 300];
  43. // Desired width of image in pixels.
  44. optional int32 width = 2 [default = 300];
  45. // Desired method when resizing image.
  46. optional ResizeType resize_method = 3 [default = BILINEAR];
  47. // Whether to also resize the image channels from 3 to 1 (RGB to grayscale).
  48. optional bool convert_to_grayscale = 4 [default = false];
  49. }