gogul09 / image-classification-python Goto Github PK
View Code? Open in Web Editor NEWUsing global feature descriptors and machine learning to perform image classification
License: MIT License
Using global feature descriptors and machine learning to perform image classification
License: MIT License
Why did you apply the global feature extraction again after splitting the data in order to predict?
The folder creation won't work on Linux. Consider renaming \\
for /
. Otherwise, the result will be something like 'dataset\train\crocus'
. It would be recommended to use pathlib
. :)
Code::
image = cv2.imread(file)
image = cv2.resize(image, fixed_size)
error Traceback (most recent call last)
in
1 # read the image and resize it to a fixed-size
2 image = cv2.imread(file)
----> 3 image = cv2.resize(image, fixed_size)
error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:3720: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'
C:\Users\vcvis\Desktop\image-classification-python-master>python global.py
Could not import submodules (exact error was: DLL load failed: The specified module could not be found.).
There are many reasons for this error the most common one is that you have
either not built the packages or have built (using python setup.py build
) or
installed them (using python setup.py install
) and then proceeded to test
mahotas without changing the current directory.
Try installing and then changing to another directory before importing mahotas.
['bluebell', 'buttercup', 'coltsfoot', 'cowslip', 'crocus', 'daffodil', 'daisy', 'dandelion', 'fritillary', 'iris', 'lilyvalley', 'pansy', 'snowdrop', 'sunflower', 'tigerlily', 'tulip', 'windflower']
Traceback (most recent call last):
File "global.py", line 80, in
fv_haralick = fd_haralick(image)
File "global.py", line 33, in fd_haralick
haralick = mahotas.features.haralick(gray).mean(axis=0)
AttributeError: module 'mahotas' has no attribute 'features'
thank you
Hey, I am not able to extract this dataset file. Can somebody help me out?
http://www.robots.ox.ac.uk/~vgg/data/flowers/17/
this is the link from where i have downloaded the dataset, which is the official site i guess.
In train_test.py, line 30 num_trees is assigned for n_estimators, which is not defined. Is it ok to use default value for n_estimators?
Let's say there are three different types of flowers in a single image. Now, how can we identify the various flowers present in that image individually?
I am trying to save the output files as .h5 files as instructed, but I keep getting the error
"TypeError: Object dtype dtype('O') has no native HDF5 equivalent"
Anyone know how to fix it, or an alternative way of saving this data?
Hi,
I got this error in the prediction line. I tried to resize my predictions but doesn't seem to work. Also the shape of Global_feature is 532. Please help.
ValueError: Number of features of the model must match the input. Model n_features is 533 and input n_features is 532
Dear gogul,
I am having an error of "C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:4044: error: (-215) ssize.width > 0 && ssize.height > 0 in function cv::resize" and " in ()" when I am executing this code.
Hi Sir Gogul,
thanks for such a detailed post on image classification.
Everything works fine in global.py till the code to save the feature vectors using HDF5
below is the error i get....And in output folder it doesn't create the two files with .h5 extension
File "c:/Users/VANESSA ANTAO/Anaconda3/python/image-classification-python-master/global.py", line 117, in
h5f_data = h5py.File(h5_data, 'w')
File "C:\Users\VANESSA ANTAO\Anaconda3\envs\opencv\lib\site-packages\h5py_hl\files.py", line 408, in init
swmr=swmr)
File "C:\Users\VANESSA ANTAO\Anaconda3\envs\opencv\lib\site-packages\h5py_hl\files.py", line 179, in make_fid
fid = h5f.create(name, h5f.ACC_TRUNC, fapl=fapl, fcpl=fcpl)
File "h5py_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py\h5f.pyx", line 108, in h5py.h5f.create
OSError: Unable to create file (unable to open file: name = 'output/data.h5', errno = 2, error message = 'No such file or directory', flags = 13, o_flags = 302)
I really need the help for my current college project
Thanks in Anticipation
When i run the code without adding any .h5 extended files in output
directory i get below error:
OSError: Unable to open file (unable to open file: name = 'output/data.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)
When i add .h5 extended files in output
directory before i run the code i get below error:
OSError: Unable to open file (file signature not found)
How can i solve the problem? Thanks in advance.
The following error:
ValueError: Expected 2D array, got 1D array instead
Using Python 3.7.3 was presented in the train_test.py code.
I solved this, adding the following sentence before obtaining rescaled_feature
global_feature= np.reshape(global_feature, (2, -1))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.