mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 17:17:14 +08:00

* update .gitignore * Added checking for cmake include dir * fixed missing trt_backend option bug when init from trt * remove un-need data layout and add pre-check for dtype * changed RGB2BRG to BGR2RGB in ppcls model * add model_zoo yolov6 c++/python demo * fixed CMakeLists.txt typos * update yolov6 cpp/README.md * add yolox c++/pybind and model_zoo demo * move some helpers to private * fixed CMakeLists.txt typos * add normalize with alpha and beta * add version notes for yolov5/yolov6/yolox * add copyright to yolov5.cc * revert normalize * fixed some bugs in yolox * Add YOLOv5Face Model support * fixed examples/vision typos * fixed runtime_option print func bugs
18 lines
391 B
Python
18 lines
391 B
Python
import fastdeploy as fd
|
|
import cv2
|
|
|
|
# 加载模型
|
|
model = fd.vision.deepcam.YOLOv5Face("yolov5s-face.onnx")
|
|
|
|
# 预测图片
|
|
im = cv2.imread("test.jpg")
|
|
result = model.predict(im, conf_threshold=0.1, nms_iou_threshold=0.3)
|
|
|
|
# 可视化结果
|
|
fd.vision.visualize.vis_face_detection(im, result)
|
|
cv2.imwrite("vis_result.jpg", im)
|
|
|
|
# 输出预测结果
|
|
print(result)
|
|
print(model.runtime_option)
|