如何在 scikit-learn(用于计算机视觉)中使用我自己的数据集? [英] How can I work with my own dataset in scikit-learn (for computer vision)?
问题描述
如何在 scikit-learn 中使用我自己的数据集?Scikit Tutorial总是以加载他的数据集(数字数据集,花卉数据集...)为例.
How can I work with my own dataset in scikit-learn? Scikit Tutorial always take as example to load his dataset (digit dataset, flower dataset...)
http://scikit-learn.org/stable/datasets/index.html即:从 sklearn.datasets 导入 load_iris
http://scikit-learn.org/stable/datasets/index.html ie: from sklearn.datasets import load_iris
我有我的图像,但我不知道如何创建新图像.
I have my images and I have no idea how create new one.
特别是,对于开始,我使用我找到的这个例子(我使用库 opencv):
Particularly, for starting, i use this example i found (i use library opencv):
img =cv2.imread('telamone.jpg')
# Convert them to grayscale
imgg =cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
# SURF extraction
surf = cv2.SURF()
kp, descritors = surf.detect(imgg,None,useProvidedKeypoints = False)
# Setting up samples and responses for kNN
samples = np.array(descritors)
responses = np.arange(len(kp),dtype = np.float32)
我想提取一组图像的特征,以一种对实现机器学习算法有用的方式!
I would like to extract features of a set of images, in a way useful to implement a machine learning algorithm!
推荐答案
您首先需要明确定义您要实现的目标:将特征提取到一组图像中,以一种对实现机器学习算法有用的方式!"太模糊了,无法给你任何指导.
You would first need to clearly define what you are trying to achieve: "extract feature to a set of images, in a way useful to implement a machine learning algorithm!" is much too vague to give you any guidance.
你想做什么:
图片整体的图像分类(例如室内场景 vs 室外场景)?
image classification of the picture as a whole (e.g. indoor scene vs outdoor scene)?
在一组图片的子部分内进行对象识别(例如识别不同图片中同一对象的多个实例),可能使用具有各种大小窗口的扫描程序?
object recognition (e.g. recognizing several instances of the same object in different pictures) inside sub-parts of a set of pictures, maybe using a scan procedures with windows of various sizes?
对象检测和基于类的分类(例如,查找图片中所有出现的汽车或行人,以及这些类的每个实例周围的边界框)?
object detection and class-based categorization (e.g. finding all occurrences of cars or pedestrians in pictures and a bounding box around each occurrence of instances of those classes)?
全图语义解析,也就是像素的分割+每个片段的类别分类(建筑、道路、人、树)...
full picture semantic parsing a.k.a. segmentation of the pixels + class categorization of each segment (build, road, people, trees)...
这些任务中的每一个都需要不同的管道(特征提取 + 机器学习模型组合).
Each of those tasks will require different pipelines (feature extraction + machine learning models combo).
您可能应该从阅读有关该主题的书籍开始,例如:http://szeliski.org/Book/
You should probably start by reading a book on the subject, for instance: http://szeliski.org/Book/
另外作为旁注,stackoverflow 可能不是提出此类开放式问题的最佳场所.
Also as a side note, stackoverflow is probably not the best place to ask such open ended questions.
这篇关于如何在 scikit-learn(用于计算机视觉)中使用我自己的数据集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!