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

Fix evaluation import problem #11

Merged
merged 3 commits into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions csrcs/fastdeploy/vision/ppdet/ppyoloe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ bool PPYOLOE::Preprocess(Mat* mat, std::vector<FDTensor>* outputs) {

(*outputs)[1].Allocate({1, 2}, FDDataType::FP32, InputInfoOfRuntime(1).name);
float* ptr = static_cast<float*>((*outputs)[1].MutableData());
ptr[0] = mat->Height() * 1.0 / mat->Height();
ptr[1] = mat->Width() * 1.0 / mat->Width();
ptr[0] = mat->Height() * 1.0 / origin_h;
ptr[1] = mat->Width() * 1.0 / origin_w;
return true;
}

Expand Down
1 change: 0 additions & 1 deletion fastdeploy/vision/evaluation/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@
from .map_utils import *
from .coco_utils import *
from .coco import *
from .cityscapes import Cityscapes
1 change: 0 additions & 1 deletion fastdeploy/vision/evaluation/utils/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from __future__ import absolute_import
import copy
import os.path as osp
import six
import sys
import numpy as np
from . import fd_logging as logging
Expand Down
5 changes: 3 additions & 2 deletions fastdeploy/vision/evaluation/utils/coco_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@

import sys
import numpy as np
import itertools
from .map_utils import draw_pr_curve
from .json_results import get_det_res, get_det_poly_res, get_seg_res, get_solov2_segm_res
import logging as logging
from . import fd_logging as logging
import copy


Expand Down Expand Up @@ -202,6 +201,8 @@ def cocoapi_eval(anns,
file_name='{}_precision_recall_curve.jpg'.format(nm["name"]))

num_columns = min(6, len(results_per_category) * 2)

import itertools
results_flatten = list(itertools.chain(*results_per_category))
headers = ['category', 'AP'] * (num_columns // 2)
results_2d = itertools.zip_longest(
Expand Down
5 changes: 4 additions & 1 deletion model_zoo/vision/yolov7/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@
#下载yolov7模型文件
wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt

# 导出onnx格式文件
# 导出onnx格式文件 (Tips: 对应 YOLOv7 release v0.1 代码)
python models/export.py --grid --dynamic --weights PATH/TO/yolov7.pt

# 如果您的代码版本中有支持NMS的ONNX文件导出,请使用如下命令导出ONNX文件(请暂时不要使用 "--end2end",我们后续将支持带有NMS的ONNX模型的部署)
python export.py --grid --dynamic --weights PATH/TO/yolov7.pt

# 移动onnx文件到demo目录
cp PATH/TO/yolov7.onnx PATH/TO/model_zoo/vision/yolov7/
```
Expand Down
4 changes: 3 additions & 1 deletion model_zoo/vision/yolov7/cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
#下载yolov7模型文件
wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt

# 导出onnx格式文件
# 导出onnx格式文件 (Tips: 对应 YOLOv7 release v0.1 代码)
python models/export.py --grid --dynamic --weights PATH/TO/yolov7.pt

# 如果您的代码版本中有支持NMS的ONNX文件导出,请使用如下命令导出ONNX文件(请暂时不要使用 "--end2end",我们后续将支持带有NMS的ONNX模型的部署)
python export.py --grid --dynamic --weights PATH/TO/yolov7.pt
```


Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
opencv-python
tqdm
numpy
pycocotools
colorama
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
setup_configs["TRT_DIRECTORY"] = os.getenv("TRT_DIRECTORY", "UNDEFINED")
setup_configs["CUDA_DIRECTORY"] = os.getenv("CUDA_DIRECTORY",
"/usr/local/cuda")
if os.getenv("CMAKE_CXX_COMPILER", None) is not None:
setup_configs["CMAKE_CXX_COMPILER"] = os.getenv("CMAKE_CXX_COMPILER")

TOP_DIR = os.path.realpath(os.path.dirname(__file__))
SRC_DIR = os.path.join(TOP_DIR, "fastdeploy")
Expand Down