-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Object Detection] Gluoncv SSD support on CPU #2353
Changes from 1 commit
1da5012
1eb27a8
1e2cdb5
d892867
c19526b
9e0eee7
037ca23
8f9e9e2
5c5e6f7
3054af5
ef21b02
31f0927
fb43612
717e61c
b9681ee
e277a55
ef00b7f
fa89a2a
925c140
6819dc3
8eaff5c
7423762
b3c8a7c
986c4f7
e7df94c
45b6aac
26ece34
2f8aef8
d30be86
6b1fd7a
42571cf
f8fecec
11c8bba
908eedb
9743f15
4bd6fec
d1e95f9
292130d
fb94ffe
5c0cee9
28d479a
c2e02e4
d20024c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,19 +58,35 @@ struct MultiBoxTransformLocAttrs | |
} | ||
}; | ||
|
||
/*! \brief Attributes used in non_maximum_suppression operators */ | ||
/*! \brief Attributes used in get_valid_counts operator */ | ||
struct GetValidCountsAttrs : public tvm::AttrsNode<GetValidCountsAttrs>{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: public tvm::AttrsNode { space |
||
double score_threshold; | ||
|
||
TVM_DECLARE_ATTRS(GetValidCountsAttrs, "relay.attrs.GetValidCountsAttrs") { | ||
TVM_ATTR_FIELD(score_threshold).set_default(0.0) | ||
.describe("Lower limit of score for valid bounding boxes."); | ||
} | ||
}; | ||
|
||
/*! \brief Attributes used in non_maximum_suppression operator */ | ||
struct NMSAttrs : public tvm::AttrsNode<NMSAttrs>{ | ||
double overlap_threshold; | ||
double iou_threshold; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let us deliberate on the choice of the parameter name. In particular why the name
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. iou_threshold is the threshold of intersection over union(IoU). This is different from mxnet API, but I think it might be easier to understand in object detection context? @zhreshold You are right. id_index in fact means axis. I think we can change it to id_axis. do_rearrange is whether to move all invalid boxed to the bottom. Maybe we can change it to invalid_to_bottom to be more meaningful? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not have a strong opinion on the naming choices, but perhaps it would be helpful to bring several people who are involved. Mainly because API relates to backward compatibility and we want to be careful. How about a quick RFC? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
bool force_suppress; | ||
int topk; | ||
int id_index; | ||
bool do_rearrange; | ||
|
||
TVM_DECLARE_ATTRS(NMSAttrs, "relay.attrs.NMSAttrs") { | ||
TVM_ATTR_FIELD(overlap_threshold).set_default(0.5) | ||
.describe("Non-maximum suppression threshold."); | ||
TVM_ATTR_FIELD(force_suppress).set_default(false) | ||
.describe("Suppress all detections regardless of class_id."); | ||
TVM_ATTR_FIELD(topk).set_default(-1) | ||
.describe("Keep maximum top k detections before nms, -1 for no limit."); | ||
TVM_ATTR_FIELD(iou_threshold).set_default(0.5) | ||
.describe("Non-maximum suppression threshold."); | ||
TVM_ATTR_FIELD(force_suppress).set_default(false) | ||
.describe("Suppress all detections regardless of class_id."); | ||
TVM_ATTR_FIELD(topk).set_default(-1) | ||
.describe("Keep maximum top k detections before nms, -1 for no limit."); | ||
TVM_ATTR_FIELD(id_index).set_default(0) | ||
.describe("Axis index of id."); | ||
TVM_ATTR_FIELD(do_rearrange).set_default(false) | ||
.describe("Whether to move all valid bounding boxes to the top."); | ||
} | ||
}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we already have a slice op. Let us just use that one to avoid duplication:
see https://docs.tvm.ai/langref/relay_op.html#tvm.relay.strided_slice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem of directly using strided_slice to generate slice_axis in the frontend converter is we need to know the input shape to generate arguments for strided_slice. This is the major task in compute of slice_axis. After this is done, we just call strided_slice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we only need to know the input dimension instead of the shape?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, input dimension.