Comments (5)
您好,感谢您对PaddleClas的认可,数据去重这个过程,我们使用的是SIFT匹配去重的思路。具体地,主要有以下几个步骤
- 基于SIFT提取特征点
- 基于特征点,获取具有尺度和旋转不变性的特征向量
- 计算并比较22k数据集与imagenet1k 验证集中所有图片的特征向量相似度,设置合适的阈值,当相似度大于阈值时,说明图像相似,需要进行去重。
from paddleclas.
@littletomatodonkey 感谢回复, 我从网上找了一下相关的方法, 能帮我看一下这样处理的结果可以算作相似度吗?
`import cv2
class SiftMatch(object):
def __init__(self, thresh=.75):
"""
:param thresh: 图片距离统计的阈值, 小于改阈值的才会被视为成功的匹配点
"""
self.thresh = thresh
self.sift = cv2.xfeatures2d.SIFT_create()
# BFMatcher with default params
self.bf = cv2.BFMatcher()
def calc_similarity(self, img1, img2):
"""
计算相似度
:param img1: 图片1, 灰度图
:param img2: 图片2, 灰度图
:return: 相似度
"""
assert len(img1.shape) == len(img2.shape) == 2
kp1, des1 = self.sift.detectAndCompute(img1, None)
kp2, des2 = self.sift.detectAndCompute(img2, None)
matches = self.bf.knnMatch(des1, des2, k=2)
good = []
for m, n in matches:
if m.distance < self.thresh * n.distance:
good.append([m])
return len(good) / len(matches)
if name == 'main':
img1 = cv2.imread('./demo01.jpg', 0)
img2 = cv2.imread('./demo02.jpg', 0)
sift = SiftMatch()
sim = sift.calc_similarity(img1, img2)
print(sim)
`
from paddleclas.
您好,可以的,这个distance指的是两个特征向量之间的欧式距离,距离越小,表示越相似,也可以可以作为相似度的评估指标的
from paddleclas.
多谢答疑, 非常期待你们可以开源自己的去重方法, 也希望paddle的生态越来越完美
from paddleclas.
您好,感谢您对PaddleClas的认可,数据去重这个过程,我们使用的是SIFT匹配去重的思路。具体地,主要有以下几个步骤
- 基于SIFT提取特征点
- 基于特征点,获取具有尺度和旋转不变性的特征向量
- 计算并比较22k数据集与imagenet1k 验证集中所有图片的特征向量相似度,设置合适的阈值,当相似度大于阈值时,说明图像相似,需要进行去重。
请问设置合适的阈值,具体是设置为多少啊?
from paddleclas.
Related Issues (20)
- PaddleClas/docs/en/PULC /PULC_person_attribute python tools/infer.py error HOT 1
- 为什么训练日志中train内top1和top5准确值不打印出来了? HOT 1
- clarity_assessment_infer.tar 下载链接不存在 HOT 1
- 图像识别微调之后效果反而变差了 HOT 3
- paddleclas模型训练gpu如何高效利用 HOT 3
- PULC微调text_image_orientation模型大量误识别0°为180°的问题 HOT 3
- 模型clarity_assessment不存在 HOT 4
- 用PaddleClas训练2类模型,训练的top1精度错误。在训练过程中推理验证集和训练完成后单独推理验证集输出结果不一致。 HOT 19
- PP-ShiTu V2图像识别系统存在内存泄漏问题 HOT 2
- 按照文档 使用 paddle_serving 部署 PLUC 的clarity_assessment 清晰度检测模型,接口调用报错 HOT 6
- 请问PP-Shitu v2是不是不支持Windows下的C++调用? HOT 4
- 行人属性检测的C++部署代码是哪个? HOT 4
- Feature Request: Extend Confusion Matrix Support in to Single-Label Classification HOT 3
- 训练多标签使用MobileNetV1_multilabel.yaml,multilabelloss.py报错 HOT 5
- 微调训练识图模型后,特征检索未达到预期效果 HOT 3
- 度量学习nan是不是单纯是召回没命中? HOT 1
- 建议支持PaddlePaddle 3.0 HOT 1
- 下载EfficientNetV2_S模型时报错 HOT 2
- swin_transformer_v2.py中第689行output_dimensions未定义 HOT 1
- dataloader无法正确加载数据 HOT 10
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 paddleclas.