Comments (10)
paddlex是否有对应的接口,可以根据deeplabv3+获取的结果截图,或者告诉我返回值都是什么,我怎么来用矩形把结果在图片中框起来并截图。
如果是想框起来,为什么不用目标检测呢
from paddlex.
是这样的,我检测的是电,水表盘上的数字,但是由于各种拍摄角度的问题,很多情况下都是歪的,用目标检测标注的话不好标,所以尝试用语义分割的方法,可以明确位置然后截取并识别,才会有这样的需求,不知道这样的方式对不对
from paddlex.
是这样的,我检测的是电,水表盘上的数字,但是由于各种拍摄角度的问题,很多情况下都是歪的,用目标检测标注的话不好标,所以尝试用语义分割的方法,可以明确位置然后截取并识别,才会有这样的需求,不知道这样的方式对不对
可以采取如下方法
1. 预测
import paddlex as pdx
model = pdx.load_model('output/unet/best_model')
result = model.predict('optic_disc_seg/JPEGImages/N0158.jpg')
pdx.seg.visualize('optic_disc_seg/JPEGImages/N0158.jpg', result, weight=0.0, save_dir='./')
2.将mask转为多边形polygon
import cv2
contours, hier = cv2.findContours(result['label_map'], cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
image = cv2.imread('optic_disc_seg/JPEGImages/N0158.jpg')
tmp = cv2.polylines(image, contours, 1, (0,0,255), 3)
cv2.imwrite('visualize_N0158.1.jpg', tmp)
3.将多边形polygon转矩形
x_min = contours[0][:, :, 0].min()
y_min = contours[0][:, :, 1].min()
x_max = contours[0][:, :, 0].max()
y_max = contours[0][:, :, 1].max()
image = cv2.imread('optic_disc_seg/JPEGImages/N0158.jpg')
tmp = cv2.rectangle(image, (x_min, y_min), (x_max, y_max), (0, 0, 255), 3)
cv2.imwrite('visualize_N0158.3.jpg', tmp)
from paddlex.
非常感谢!!!
from paddlex.
您好,请问有什么办法可以将矩形是带角度的那种吗,因为表盘可能是歪的,所以矩形希望可以跟表盘数字有相同的角度。我用了上面那种方法,发现跟我想要的还不太一样
from paddlex.
您好,请问有什么办法可以将矩形是带角度的那种吗,因为表盘可能是歪的,所以矩形希望可以跟表盘数字有相同的角度。我用了上面那种方法,发现跟我想要的还不太一样
这个可以在网上搜一下方法,如何对一个多边形polygon拟合一个rotated rectangle
from paddlex.
好的,谢谢
from paddlex.
你好,我拟合出了这个矩形了,得到了四个坐标点,请问百度有没有好用的根据四个坐标点切图的方法,网上没有能用的。。。要不然我只能自己写了
from paddlex.
你好,我拟合出了这个矩形了,得到了四个坐标点,请问百度有没有好用的根据四个坐标点切图的方法,网上没有能用的。。。要不然我只能自己写了
PaddleX目前没有相关的脚本或工具
from paddlex.
好的,我自己写就可以了~感谢
from paddlex.
Related Issues (20)
- 训练异常终止,请重新开始训练 HOT 1
- windows11 运行paddlex,执行图片分类任务的训练时,提示CUSOLVER_STATUS_INTERNAL_ERROR错误 HOT 3
- PaddleX客户端无法进入工作界面问题 HOT 5
- 使用PaddleDetection训练出了yolo3_mobileNet_v3模型后,通过paddle-lite-demo中的yolo-detection-demo来运行,运行环境是荣耀9的安卓真机。
- PaddleX的seg模型在GPU上推理速度很慢 HOT 1
- 单机多卡训练时存在内存泄漏现象 HOT 1
- 点击启动训练后报错 HOT 1
- ocrv4模型选择问题 HOT 1
- 使用paddleseg中的slim剪枝Bisenetv2出现AssertionError: The length of current_mask must be equal to the size of dimension to be pruned on. HOT 1
- AttributeError: module 'paddle' has no attribute 'distributed' HOT 1
- paddlex BML训练报错:(InvalidArgument) yolo_box(): argument 'X' (position 0) must be Tensor, but got Tensor (at /paddle/paddle/fluid/pybind/op_function_common.cc:818) HOT 1
- 本机可以正常运行,换一台机器无法运行
- 可视化客户端无法训练 HOT 1
- ModuleNotFoundError: No module named 'paddle.fluid' HOT 1
- 安装Paddlex 2.0失败 HOT 1
- No voc record found in %s' % (file_list) HOT 1
- 在Kaggle上安装paddlex包失败 HOT 1
- paddle-gpu2.6.0运行paddlex的maskrcnn遇到ValueError: (InvalidArgument) multiclass_nms3(): argument (position 4) must be double, but got str HOT 1
- RandomVerticalFlip 的 apply_bbox 方法api存在bug HOT 2
- 在paddlex在线工具箱里运行PP-YOLOE_plus_crn_s_80e_副本跑自己数据集出现api.base.utils.errors.CalledProcessError HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paddlex.