Skip to content
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

Support static graph code-gen for yolo_box #52714

Merged
merged 7 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion paddle/fluid/operators/detection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ else()
detection_library(iou_similarity_op SRCS iou_similarity_op.cc
iou_similarity_op.cu)
detection_library(prior_box_op SRCS prior_box_op.cc)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只删除yolo_box_op.cc相关的,这句不要删除呀

detection_library(yolo_box_op SRCS yolo_box_op.cc)
sanbuphy marked this conversation as resolved.
Show resolved Hide resolved
# detection_library(generate_proposals_v2_op SRCS generate_proposals_v2_op.cc)
endif()

Expand Down
269 changes: 0 additions & 269 deletions paddle/fluid/operators/detection/yolo_box_op.cc

This file was deleted.

9 changes: 0 additions & 9 deletions paddle/phi/api/yaml/legacy_ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1547,15 +1547,6 @@
data_type: x
backward: unpool3d_grad

- op : yolo_box
args : (Tensor x, Tensor img_size, int[] anchors, int class_num, float conf_thresh, int downsample_ratio, bool clip_bbox, float scale_x_y=1.0, bool iou_aware=false, float iou_aware_factor=0.5)
output : Tensor(boxes), Tensor(scores)
infer_meta :
func : YoloBoxInferMeta
kernel :
func : yolo_box
data_type : x

- op : yolo_loss
args : (Tensor x, Tensor gt_box, Tensor gt_label, Tensor gt_score, int[] anchors, int[] anchor_mask, int class_num, float ignore_thresh, int downsample_ratio, bool use_label_smooth=true, float scale_x_y=1.0)
output : Tensor(loss), Tensor(objectness_mask), Tensor(gt_match_mask)
Expand Down
6 changes: 6 additions & 0 deletions paddle/phi/api/yaml/op_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2216,6 +2216,12 @@
extra :
attrs : ['str[] skip_eager_deletion_vars = {}']

- op : yolo_box
inputs :
{x : X, img_size : ImgSize}
outputs :
{boxes : Boxes, scores : Scoes}
sanbuphy marked this conversation as resolved.
Show resolved Hide resolved

- op: sigmoid_cross_entropy_with_logits
backward: sigmoid_cross_entropy_with_logits_grad
inputs :
Expand Down
11 changes: 11 additions & 0 deletions paddle/phi/api/yaml/op_version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,14 @@
- add_attr : axis
comment : The axis to apply unique. If None, the input will be flattened.
default : std::vector<int>{}

- op : yolo_box
version :
- checkpoint : Upgrade yolo box to add new attribute [iou_aware, iou_aware_factor].
action :
- add_attr : iou_aware
comment : Whether use iou aware.
default : "false"
- add_attr : iou_aware_factor
comment : iou aware factor.
default : 0.5f
9 changes: 9 additions & 0 deletions paddle/phi/api/yaml/ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1858,3 +1858,12 @@
kernel :
func : where
backward : where_grad

- op : yolo_box
args : (Tensor x, Tensor img_size, int[] anchors={}, int class_num = 1, float conf_thresh = 0.01, int downsample_ratio = 32, bool clip_bbox = true, float scale_x_y=1.0, bool iou_aware=false, float iou_aware_factor=0.5)
output : Tensor(boxes), Tensor(scores)
infer_meta :
func : YoloBoxInferMeta
kernel :
func : yolo_box
data_type : x
35 changes: 0 additions & 35 deletions paddle/phi/ops/compat/yolo_box_sig.cc

This file was deleted.