MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / NMSShapeFn

Function NMSShapeFn

tensorflow/core/ops/image_ops.cc:111–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111Status NMSShapeFn(InferenceContext* c) {
112 // Get inputs and validate ranks.
113 ShapeHandle boxes;
114 TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 2, &boxes));
115 ShapeHandle scores;
116 TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 1, &scores));
117 ShapeHandle max_output_size;
118 TF_RETURN_IF_ERROR(c->WithRank(c->input(2), 0, &max_output_size));
119 ShapeHandle iou_threshold;
120 TF_RETURN_IF_ERROR(c->WithRank(c->input(3), 0, &iou_threshold));
121 ShapeHandle score_threshold;
122 TF_RETURN_IF_ERROR(c->WithRank(c->input(4), 0, &score_threshold));
123 // The boxes is a 2-D float Tensor of shape [num_boxes, 4].
124 DimensionHandle unused;
125 // The boxes[0] and scores[0] are both num_boxes.
126 TF_RETURN_IF_ERROR(c->Merge(c->Dim(boxes, 0), c->Dim(scores, 0), &unused));
127 // The boxes[1] is 4.
128 TF_RETURN_IF_ERROR(c->WithValue(c->Dim(boxes, 1), 4, &unused));
129
130 c->set_output(0, c->Vector(c->UnknownDim()));
131 return Status::OK();
132}
133
134Status SoftNMSShapeFn(InferenceContext* c) {
135 // Get inputs and validate ranks.

Callers 1

image_ops.ccFile · 0.85

Calls 8

WithValueMethod · 0.80
VectorMethod · 0.80
UnknownDimMethod · 0.80
WithRankMethod · 0.45
inputMethod · 0.45
MergeMethod · 0.45
DimMethod · 0.45
set_outputMethod · 0.45

Tested by

no test coverage detected