Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Oneflow-Inc
oneflow_yolov3
提交
fde5ac94
O
oneflow_yolov3
项目概览
Oneflow-Inc
/
oneflow_yolov3
9 个月 前同步成功
通知
4
Star
6
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oneflow_yolov3
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
fde5ac94
编写于
1月 04, 2021
作者:
G
guo ran
提交者:
GitHub
1月 04, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #20 from Oneflow-Inc/dev_ldp
sync with the lastest oneflow master branch
上级
c19a4b26
0676037f
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
42 addition
and
45 deletion
+42
-45
ops/logistic_kernel.cpp
ops/logistic_kernel.cpp
+1
-1
ops/yolo_box_diff_kernel.cu
ops/yolo_box_diff_kernel.cu
+3
-5
ops/yolo_box_diff_op.cpp
ops/yolo_box_diff_op.cpp
+8
-8
ops/yolo_detect_kernel.cu
ops/yolo_detect_kernel.cu
+2
-3
ops/yolo_detect_op.cpp
ops/yolo_detect_op.cpp
+8
-8
ops/yolo_non_maximum_suppression.cpp
ops/yolo_non_maximum_suppression.cpp
+3
-3
ops/yolo_non_maximum_suppression_gpu.cu
ops/yolo_non_maximum_suppression_gpu.cu
+1
-1
ops/yolo_predict_decoder.cpp
ops/yolo_predict_decoder.cpp
+4
-4
ops/yolo_prob_loss_kernel.cu
ops/yolo_prob_loss_kernel.cu
+1
-1
ops/yolo_prob_loss_op.cpp
ops/yolo_prob_loss_op.cpp
+1
-1
ops/yolo_train_decoder.cpp
ops/yolo_train_decoder.cpp
+10
-10
未找到文件。
ops/logistic_kernel.cpp
浏览文件 @
fde5ac94
...
...
@@ -24,7 +24,7 @@ class LogisticKernel final : public user_op::OpKernel {
#define REGISTER_LOGISTIC_KERNEL(device, dtype) \
REGISTER_USER_KERNEL("logistic") \
.SetCreateFn<LogisticKernel<device, dtype>>() \
.SetIsMatchedHob((user_op::HobDeviceT
ype
() == device) \
.SetIsMatchedHob((user_op::HobDeviceT
ag
() == device) \
& (user_op::HobDataType("out", 0) == GetDataType<dtype>::value)) \
.SetInplaceProposalFn([](const user_op::InferContext&, \
user_op::AddInplaceArgPair AddInplaceArgPairFn) -> Maybe<void> { \
...
...
ops/yolo_box_diff_kernel.cu
浏览文件 @
fde5ac94
...
...
@@ -319,13 +319,11 @@ class YoloBoxDiffKernel final : public user_op::OpKernel {
Memcpy
<
DeviceType
::
kGPU
>
(
ctx
->
device_ctx
(),
reinterpret_cast
<
void
*>
(
buf_manager
.
AnchorBoxesTmpPtr
()),
reinterpret_cast
<
void
*>
(
anchor_boxes
.
data
()),
buf_manager
.
AnchorBoxesTmpElemCnt
()
*
sizeof
(
int32_t
),
cudaMemcpyHostToDevice
);
buf_manager
.
AnchorBoxesTmpElemCnt
()
*
sizeof
(
int32_t
));
Memcpy
<
DeviceType
::
kGPU
>
(
ctx
->
device_ctx
(),
reinterpret_cast
<
void
*>
(
buf_manager
.
BoxMaskTmpPtr
()),
reinterpret_cast
<
void
*>
(
box_mask
.
data
()),
buf_manager
.
BoxMaskTmpElemCnt
()
*
sizeof
(
int32_t
),
cudaMemcpyHostToDevice
);
buf_manager
.
BoxMaskTmpElemCnt
()
*
sizeof
(
int32_t
));
Memset
<
DeviceType
::
kGPU
>
(
ctx
->
device_ctx
(),
statistics_info
->
mut_dptr
<
float
>
(),
0
,
statistics_info
->
shape
().
elem_cnt
()
*
sizeof
(
float
));
FOR_RANGE
(
int32_t
,
im_index
,
0
,
bbox
->
shape
().
At
(
0
))
{
...
...
@@ -380,7 +378,7 @@ class YoloBoxDiffKernel final : public user_op::OpKernel {
#define REGISTER_YOLO_BOX_DIFF_GPU_KERNEL(dtype) \
REGISTER_USER_KERNEL("yolo_box_diff") \
.SetCreateFn<YoloBoxDiffKernel<dtype>>() \
.SetIsMatchedHob((user_op::HobDeviceT
ype
() == DeviceType::kGPU) \
.SetIsMatchedHob((user_op::HobDeviceT
ag
() == DeviceType::kGPU) \
& (user_op::HobDataType("bbox", 0) == GetDataType<dtype>::value) \
& (user_op::HobDataType("gt_boxes", 0) == GetDataType<dtype>::value)) \
.SetInferTmpSizeFn([](user_op::InferContext* ctx) { \
...
...
ops/yolo_box_diff_op.cpp
浏览文件 @
fde5ac94
...
...
@@ -13,14 +13,14 @@ REGISTER_USER_OP("yolo_box_diff")
.
Output
(
"neg_inds"
)
.
Output
(
"valid_num"
)
.
Output
(
"statistics_info"
)
.
Attr
(
"image_height"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"image_width"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"layer_height"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"layer_width"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"ignore_thresh"
,
UserOpAttrType
::
kAtFloat
)
.
Attr
(
"truth_thresh"
,
UserOpAttrType
::
kAtFloat
)
.
Attr
(
"anchor_boxes"
,
UserOpAttrType
::
kAtListInt32
)
.
Attr
(
"box_mask"
,
UserOpAttrType
::
kAtListInt32
)
.
Attr
<
int32_t
>
(
"image_height"
)
.
Attr
<
int32_t
>
(
"image_width"
)
.
Attr
<
int32_t
>
(
"layer_height"
)
.
Attr
<
int32_t
>
(
"layer_width"
)
.
Attr
<
float
>
(
"ignore_thresh"
)
.
Attr
<
float
>
(
"truth_thresh"
)
.
Attr
<
std
::
vector
<
int32_t
>>
(
"anchor_boxes"
)
.
Attr
<
std
::
vector
<
int32_t
>>
(
"box_mask"
)
.
SetTensorDescInferFn
([](
user_op
::
InferContext
*
ctx
)
->
Maybe
<
void
>
{
// input: bbox : (n, r, 4) r = h*w*3
const
user_op
::
TensorDesc
*
bbox_desc
=
ctx
->
TensorDesc4ArgNameAndIndex
(
"bbox"
,
0
);
...
...
ops/yolo_detect_kernel.cu
浏览文件 @
fde5ac94
...
...
@@ -142,8 +142,7 @@ class YoloDetectGpuKernel final : public user_op::OpKernel {
Memcpy
<
DeviceType
::
kGPU
>
(
ctx
->
device_ctx
(),
reinterpret_cast
<
void
*>
(
buf_manager
.
AnchorBoxesTmpPtr
()),
reinterpret_cast
<
void
*>
(
anchor_boxes
.
data
()),
buf_manager
.
AnchorBoxesTmpElemCnt
()
*
sizeof
(
int32_t
),
cudaMemcpyHostToDevice
);
buf_manager
.
AnchorBoxesTmpElemCnt
()
*
sizeof
(
int32_t
));
FOR_RANGE
(
int32_t
,
im_index
,
0
,
bbox
->
shape
().
At
(
0
))
{
const
T
*
probs_ptr
=
probs
->
dptr
<
T
>
()
+
im_index
*
probs
->
shape
().
Count
(
1
);
...
...
@@ -175,7 +174,7 @@ class YoloDetectGpuKernel final : public user_op::OpKernel {
#define REGISTER_YOLO_DETECT_GPU_KERNEL(dtype) \
REGISTER_USER_KERNEL("yolo_detect") \
.SetCreateFn<YoloDetectGpuKernel<dtype>>() \
.SetIsMatchedHob((user_op::HobDeviceT
ype
() == DeviceType::kGPU) \
.SetIsMatchedHob((user_op::HobDeviceT
ag
() == DeviceType::kGPU) \
& (user_op::HobDataType("bbox", 0) == GetDataType<dtype>::value) \
& (user_op::HobDataType("probs", 0) == GetDataType<dtype>::value)) \
.SetInferTmpSizeFn([](user_op::InferContext* ctx) { \
...
...
ops/yolo_detect_op.cpp
浏览文件 @
fde5ac94
...
...
@@ -9,14 +9,14 @@ REGISTER_USER_OP("yolo_detect")
.
Output
(
"out_bbox"
)
.
Output
(
"out_probs"
)
.
Output
(
"valid_num"
)
.
Attr
(
"image_height"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"image_width"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"layer_height"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"layer_width"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"prob_thresh"
,
UserOpAttrType
::
kAtFloat
)
.
Attr
(
"num_classes"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"anchor_boxes"
,
UserOpAttrType
::
kAtListInt32
)
.
Attr
(
"max_out_boxes"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
<
int32_t
>
(
"image_height"
)
.
Attr
<
int32_t
>
(
"image_width"
)
.
Attr
<
int32_t
>
(
"layer_height"
)
.
Attr
<
int32_t
>
(
"layer_width"
)
.
Attr
<
float
>
(
"prob_thresh"
)
.
Attr
<
int32_t
>
(
"num_classes"
)
.
Attr
<
std
::
vector
<
int32_t
>>
(
"anchor_boxes"
)
.
Attr
<
int32_t
>
(
"max_out_boxes"
)
.
SetTensorDescInferFn
([](
user_op
::
InferContext
*
ctx
)
->
Maybe
<
void
>
{
// bbox : (n, h*w*3, 4) probs : (n, h*w*3, 81)
// out_bbox : (n, max_out_boxes, 4) out_probs : (n, max_out_boxes, 81)
...
...
ops/yolo_non_maximum_suppression.cpp
浏览文件 @
fde5ac94
...
...
@@ -6,9 +6,9 @@ REGISTER_USER_OP("yolo_nms")
.
Input
(
"bbox"
)
.
Input
(
"probs"
)
.
Output
(
"out"
)
.
Attr
(
"iou_threshold"
,
UserOpAttrType
::
kAtFloat
)
.
Attr
(
"keep_n"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"batch_dims"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
<
float
>
(
"iou_threshold"
)
.
Attr
<
int32_t
>
(
"keep_n"
)
.
Attr
<
int32_t
>
(
"batch_dims"
)
.
SetTensorDescInferFn
([](
user_op
::
InferContext
*
ctx
)
->
Maybe
<
void
>
{
Shape
*
bbox_shape
=
ctx
->
Shape4ArgNameAndIndex
(
"bbox"
,
0
);
DimVector
dim_vec
(
bbox_shape
->
NumAxes
()
-
1
);
...
...
ops/yolo_non_maximum_suppression_gpu.cu
浏览文件 @
fde5ac94
...
...
@@ -140,7 +140,7 @@ class YoloNmsGpuKernel final : public user_op::OpKernel {
#define REGISTER_YOLO_NMS_GPU_KERNEL(dtype) \
REGISTER_USER_KERNEL("yolo_nms") \
.SetCreateFn<YoloNmsGpuKernel<dtype>>() \
.SetIsMatchedHob((user_op::HobDeviceT
ype
() == DeviceType::kGPU) \
.SetIsMatchedHob((user_op::HobDeviceT
ag
() == DeviceType::kGPU) \
& (user_op::HobDataType("out", 0) == DataType::kInt8) \
& (user_op::HobDataType("bbox", 0) == GetDataType<dtype>::value)) \
.SetInferTmpSizeFn([](user_op::InferContext* ctx) { \
...
...
ops/yolo_predict_decoder.cpp
浏览文件 @
fde5ac94
...
...
@@ -31,10 +31,10 @@ class DecodeOpKernelState final : public user_op::OpKernelState {
REGISTER_USER_OP
(
"yolo_predict_decoder"
)
.
Output
(
"out"
)
.
Output
(
"origin_image_info"
)
.
Attr
(
"batch_size"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"image_height"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"image_width"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"image_paths"
,
UserOpAttrType
::
kAtListString
)
.
Attr
<
int32_t
>
(
"batch_size"
)
.
Attr
<
int32_t
>
(
"image_height"
)
.
Attr
<
int32_t
>
(
"image_width"
)
.
Attr
<
std
::
vector
<
std
::
string
>>
(
"image_paths"
)
.
SetTensorDescInferFn
([](
user_op
::
InferContext
*
ctx
)
->
Maybe
<
void
>
{
Shape
*
out_shape
=
ctx
->
Shape4ArgNameAndIndex
(
"out"
,
0
);
Shape
*
origin_image_info_shape
=
ctx
->
Shape4ArgNameAndIndex
(
"origin_image_info"
,
0
);
...
...
ops/yolo_prob_loss_kernel.cu
浏览文件 @
fde5ac94
...
...
@@ -114,7 +114,7 @@ class YoloProbLossKernel final : public user_op::OpKernel {
#define REGISTER_YOLO_PROB_LOSS_KERNEL(dtype) \
REGISTER_USER_KERNEL("yolo_prob_loss") \
.SetCreateFn<YoloProbLossKernel<dtype>>() \
.SetIsMatchedHob((user_op::HobDeviceT
ype
() == DeviceType::kGPU) \
.SetIsMatchedHob((user_op::HobDeviceT
ag
() == DeviceType::kGPU) \
& (user_op::HobDataType("bbox_objness", 0) == GetDataType<dtype>::value) \
& (user_op::HobDataType("bbox_clsprob", 0) == GetDataType<dtype>::value)) \
.SetInferTmpSizeFn([](const oneflow::user_op::InferContext*) { return 0; });
...
...
ops/yolo_prob_loss_op.cpp
浏览文件 @
fde5ac94
...
...
@@ -11,7 +11,7 @@ REGISTER_USER_OP("yolo_prob_loss")
.
Input
(
"valid_num"
)
.
Output
(
"bbox_objness_out"
)
.
Output
(
"bbox_clsprob_out"
)
.
Attr
(
"num_classes"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
<
int32_t
>
(
"num_classes"
)
.
SetTensorDescInferFn
([](
user_op
::
InferContext
*
ctx
)
->
Maybe
<
void
>
{
// input: bbox_objness : (n, r, 1) r = h*w*3
const
user_op
::
TensorDesc
*
bbox_objness_desc
=
...
...
ops/yolo_train_decoder.cpp
浏览文件 @
fde5ac94
...
...
@@ -32,16 +32,16 @@ REGISTER_USER_OP("yolo_train_decoder")
.
Output
(
"data"
)
.
Output
(
"ground_truth"
)
.
Output
(
"gt_valid_num"
)
.
Attr
(
"batch_size"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"image_height"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"image_width"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"classes"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"num_boxes"
,
UserOpAttrType
::
kAtInt32
)
.
Attr
(
"hue"
,
UserOpAttrType
::
kAtFloat
)
.
Attr
(
"jitter"
,
UserOpAttrType
::
kAtFloat
)
.
Attr
(
"saturation"
,
UserOpAttrType
::
kAtFloat
)
.
Attr
(
"exposure"
,
UserOpAttrType
::
kAtFloat
)
.
Attr
(
"image_path_file"
,
UserOpAttrType
::
kAtString
)
.
Attr
<
int32_t
>
(
"batch_size"
)
.
Attr
<
int32_t
>
(
"image_height"
)
.
Attr
<
int32_t
>
(
"image_width"
)
.
Attr
<
int32_t
>
(
"classes"
)
.
Attr
<
int32_t
>
(
"num_boxes"
)
.
Attr
<
float
>
(
"hue"
)
.
Attr
<
float
>
(
"jitter"
)
.
Attr
<
float
>
(
"saturation"
)
.
Attr
<
float
>
(
"exposure"
)
.
Attr
<
std
::
string
>
(
"image_path_file"
)
.
SetTensorDescInferFn
([](
user_op
::
InferContext
*
ctx
)
->
Maybe
<
void
>
{
user_op
::
TensorDesc
*
data_desc
=
ctx
->
TensorDesc4ArgNameAndIndex
(
"data"
,
0
);
user_op
::
TensorDesc
*
ground_truth_desc
=
ctx
->
TensorDesc4ArgNameAndIndex
(
"ground_truth"
,
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录