Machine learning image grading

I am very new to python and OpenCV.

My project is to grade images of samples from a scratch test.
heavy scratching grade 0
no scractching grade 5

So after acquision of images for training grades 0 to 5 I have to train a model,
which afterwards tells me the grading of an arbitrary sample.

Can this model building be achieved in OpenCV by itself or do
I require addition packages like ImageAI or similar.

Any advice where to start from is welcome. Thank you.



OpenCV can do the inference on deep neural networks (i.e. run the classification), but not train them.
So you’ll need a DNN library (like PyTorch or Tensorflow), a network architecture (check the model zoo) and a database to train the network.
Then use the same framework - or OpenCV* to run the classification.

[*] sometimes there are compatibility problems, and OpenCV won’t read correctly the network from other frameworks. So better stay with the same framework.