Answer the question
In order to leave comments, you need to log in
Image recognition only with NumPy?
I want to make a neural network that recognizes objects in images, but everywhere it says that you need to use the opencv and other libraries, that is, which are already prepared for this.
But I just want to make such a neural network only with the help of numpy , that is, from scratch, is it possible?
Answer the question
In order to leave comments, you need to log in
Numpy itself does not know how to process images, build connections between "neurons" and in general it is more for managing data in arrays.
But is it purely theoretically possible? Maybe. How? Well...
First of all, you need to somehow get an array of pixels. This depends on the context. If you take a picture from a file, then there is the good old PIL library for reading images. No, of course, you can write a decoder, but I'm not sure that you need it so "your own".
from PIL import Image
import numpy
img = Image.open('image.png')
pixel_map = np.array(img)
# Например, изображение с такими пикселями
# [красный][зелёный]
# [синий] [белый]
# будет представлено массивом
[, ]
pixel_sequence = [pixel for row in pixel_map for pixel in row]
Important. If we take pieces of code, we get list[list[r, g, b (, a)]]. This is not something that would be suitable for direct distribution networks (I can confuse the terminology, correct me), you can unpack the nested array again, of course, but the complexity will increase many times due to the increase in the number of input data
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question