【问题标题】:How to fit a classification model with Image-Arrays?如何使用 Image-Arrays 拟合分类模型?
【发布时间】:2021-07-29 18:17:48
【问题描述】:

我试图建立一个模型,可以根据输入图像区分蜜蜂和大黄蜂。

我的计划是构建一个分类模型,该模型将图像数组作为输入,并返回“蜜蜂”或“大黄蜂”。 我以为我可以用蜜蜂图像来拟合模型,这就是我卡住的地方。

据我所知,这是目前为止:

from PIL import Image
import numpy as np
from sklearn.linear_model import LogisticRegression


link = 'https://www.dadant.com/wp-content/uploads/2017/12/ABJ-Extra-December12-256x256.jpg'
img = Image.open(link)
x = np.array(img)
y = ['honey bee']

logreg = LogisticRegression()

logreg.fit(arr, y)

x 返回一个不能超过 logreg 的 3d 数组。

有什么方法可以拟合模型吗?也许,把 arr 变成一个数据框?

【问题讨论】:

    标签: python machine-learning image-processing scikit-learn logistic-regression


    【解决方案1】:

    Fitting a model with images

    关于构建图像分类模型的完整项目

    【讨论】:

      猜你喜欢
      • 2021-12-08
      • 1970-01-01
      • 2020-01-06
      • 2020-07-29
      • 2020-02-01
      • 2012-12-19
      • 1970-01-01
      • 1970-01-01
      • 2015-12-01
      相关资源
      最近更新 更多