Git Product home page Git Product logo

wheat-quality-detector-2's Introduction

Wheat-quality-detector-2

Inspired by link

Description:

This wheat quality detection test we are using to identify the quality of given wheat grains image. The dataset we used is provided by link.

The wheat quality detection problem is divided into two sub problems given as following:

  1. Two classs classification i.e. a healthy grain or other.
  2. Five class slassification i.e. a healthy grain, damaged grain, foreign partical, broken grain and grain cover.

The dataset we used for training (is the single grain or other images) extracted for above mentioned dataset.

Requirement:

  • opencv-python
  • keras
  • tensorflow
  • matplotlib

Tested with python3.5

A Glance

For two class classification:

 $ python classifier_2_v2.py
 68/68 [==============================] - 0s 499us/step - accuracy: 0.9020 - loss: 0.2475
 MLP Test loss: 0.247524231672287
 MLP Test accuracy: 0.9019879698753357

For five class classification:

 $ python classifier_5_v2.py
 65/65 [==============================] - 0s 532us/step - loss: 0.4837 - accuracy: 0.8254
 MLP Test loss: 0.483661413192749
 MLP Test accuracy: 0.8253890872001648

For performing a saimple test:

 $ python cmd_wheat_quality_detector_v2.py
 Enter the file(wheat image) location to dectect : test_2.jpg
 Segmentation in process...
 Level 1 segmentation Finished:
 Rejected segment: 1
 Level 2 segmentation Finished:
 Rejected segment: 21

 Total number of segments 124
 Number of rejected segments 22

 Segmentation in Complete.

 Feature extraction in process...
 Feature extraction in complete.

 Number of good grain : 84
 Number Not good grain or imputity: 18

About:

Please feel free to email & contact me if you run into issues or just would like to talk about the future usage.

wheat-quality-detector-2's People

Contributors

deepakrana47 avatar deepaksinghrana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wheat-quality-detector-2's Issues

Grain (Paddy) Detect from Image

Detect Paddy in Image

1

Count the number of paddy in a image.
I have create a Model to detect paddy using Tensorflow API Object detection model but it did not work properly, can please help me out how to do that.
I have learn a lot from your example i.e. Wheat-quality-detector.
Please tell which approach are you using and technology and some tutorial and blog are you have pls suggest.

When Run python cmd_wheat_quality_detector_v2.py

It will give me error :

`Using TensorFlow backend.
2019-10-09 10:43:05.765390: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3092785000 Hz
2019-10-09 10:43:05.765957: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x555efc684df0 executing computations on platform Host. Devices:
2019-10-09 10:43:05.765992: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): Host, Default Version
Enter the file(wheat image) location to dectect : mark.jpg
Traceback (most recent call last):
File "/media1/miniconda3/envs/test_env_36/lib/python3.6/site-packages/keras/engine/saving.py", line 382, in _deserialize_model
model.optimizer.set_weights(optimizer_weight_values)
File "/media1/miniconda3/envs/test_env_36/lib/python3.6/site-packages/keras/optimizers.py", line 126, in set_weights
'of the optimizer (' + str(len(params)) + ')')
ValueError: Length of the specified weight list (13) does not match the number of weights of the optimizer (19)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "cmd_wheat_quality_detector_v2.py", line 20, in
model = keras.models.load_model('weights_results_5out/weights_01234567.pkl')
File "/media1/miniconda3/envs/test_env_36/lib/python3.6/site-packages/keras/engine/saving.py", line 492, in load_wrapper
return load_function(*args, **kwargs)
File "/media1/miniconda3/envs/test_env_36/lib/python3.6/site-packages/keras/engine/saving.py", line 584, in load_model
model = _deserialize_model(h5dict, custom_objects, compile)
File "/media1/miniconda3/envs/test_env_36/lib/python3.6/site-packages/keras/engine/saving.py", line 384, in _deserialize_model
warnings.warn('Error in loading the saved optimizer '
UserWarning: Error in loading the saved optimizer state. As a result, your model is starting with a freshly initialized optimizer.
`
Thank You

Detect single paddy from image :

Screenshot from 2019-10-09 15-00-37

How to count number of paddy in image:

Screenshot from 2019-10-09 15-01-09

No module named 'numpy.core.multiarray\r

Traceback (most recent call last):
File "classifier_2_v2.py", line 53, in
ftrain, y_train, ftest, y_test = pickle.load(open(feat_data, 'rb'))
ImportError: No module named 'numpy.core.multiarray\r'

I am run the code and give me this error.
I am install all the requirements with there version.
HOW can solved this error?

Unable to use python 2.7

I am unable to use python 2.7 in anaconda. Can you just help me out to execute the code that you have written in python 3.7? I am unable to load the segmented data. Explain to me the approach that I have to adopt.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.