Skip to content

Commit

Permalink
feat(model): add ocr output (#94)
Browse files Browse the repository at this point in the history
Because

- support OCR task

This commit

- add OCR task output format
  • Loading branch information
Phelan164 authored and pinglin committed Aug 15, 2022
1 parent 86bba02 commit a84ed0d
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 12 deletions.
18 changes: 18 additions & 0 deletions vdp/model/v1alpha/common.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
syntax = "proto3";

package vdp.model.v1alpha;

// Google api
import "google/api/field_behavior.proto";

// BoundingBox represents the bounding box data structure
message BoundingBox {
// Bounding box top y-axis value
float top = 1 [ (google.api.field_behavior) = OUTPUT_ONLY ];
// Bounding box left x-axis value
float left = 2 [ (google.api.field_behavior) = OUTPUT_ONLY ];
// Bounding box width value
float width = 3 [ (google.api.field_behavior) = OUTPUT_ONLY ];
// Bounding box height value
float height = 4 [ (google.api.field_behavior) = OUTPUT_ONLY ];
}
12 changes: 1 addition & 11 deletions vdp/model/v1alpha/detection_output.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,7 @@ package vdp.model.v1alpha;
// Google api
import "google/api/field_behavior.proto";

// BoundingBox represents the bounding box data structure
message BoundingBox {
// Bounding box top y-axis value
float top = 1 [ (google.api.field_behavior) = OUTPUT_ONLY ];
// Bounding box left x-axis value
float left = 2 [ (google.api.field_behavior) = OUTPUT_ONLY ];
// Bounding box width value
float width = 3 [ (google.api.field_behavior) = OUTPUT_ONLY ];
// Bounding box height value
float height = 4 [ (google.api.field_behavior) = OUTPUT_ONLY ];
}
import "vdp/model/v1alpha/common.proto";

// BoundingBoxObject represents a predicted bounding box object
message BoundingBoxObject {
Expand Down
5 changes: 4 additions & 1 deletion vdp/model/v1alpha/model.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import "vdp/model/v1alpha/model_definition.proto";
import "vdp/model/v1alpha/classification_output.proto";
import "vdp/model/v1alpha/detection_output.proto";
import "vdp/model/v1alpha/keypoint_output.proto";
import "vdp/model/v1alpha/ocr_output.proto";
import "vdp/model/v1alpha/unspecified_task_output.proto";

// Model represents a model
Expand Down Expand Up @@ -495,8 +496,10 @@ message ModelInstanceOutput {
DetectionOutput detection = 2 [ (google.api.field_behavior) = OUTPUT_ONLY ];
// The keypoint output
KeypointOutput keypoint = 3 [ (google.api.field_behavior) = OUTPUT_ONLY ];
// The ocr output
OcrOutput ocr = 4 [ (google.api.field_behavior) = OUTPUT_ONLY ];
// The unspecified task output
UnspecifiedTaskOutput unspecified = 4
UnspecifiedTaskOutput unspecified = 5
[ (google.api.field_behavior) = OUTPUT_ONLY ];
}
}
Expand Down
19 changes: 19 additions & 0 deletions vdp/model/v1alpha/ocr_output.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";

package vdp.model.v1alpha;

import "vdp/model/v1alpha/common.proto";

// Google api
import "google/api/field_behavior.proto";

// OcrOutput represents the output of ocr task
message OcrOutput {
// A list of bounding box text
repeated BoundingBox bounding_boxes = 1
[ (google.api.field_behavior) = OUTPUT_ONLY ];
// A list of ocr texts
repeated string texts = 2
[ (google.api.field_behavior) = OUTPUT_ONLY ];
}

0 comments on commit a84ed0d

Please sign in to comment.