Tejas07PSK / Melanoma-Detection

A modular programming approach towards detecting/predicting Melanoma skin lesion using ImageProcessing and MachineLearning in Python.
MIT License
12 stars 4 forks source link

does not work #2

Closed prassidicePM closed 1 year ago

prassidicePM commented 1 year ago

hi, I'd like to run your code but I have problems

I'm using debian 11 and python 3.9.2, I installed numpy, matplotlib, scipy, opencv-python, and sklearn

I removed dataset

when I run Main.py I got:

$python3 Main.py ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^WELCOME TO THE MELANOMA-PREDICTION PROGRAM^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 This is a nascent approach towards detecting Melanoma-Skin-Lesion, using OpenCV, NumPY, Matplotlib and SciKit in Python Programming Language. 

 This project utilizes some of the core concepts of 'DIGITAL IMAGE PROCESSING' & 'MACHINE LEARNING'. 

 This program can categorize the cancerous-lesion as Malignant, Benign or Negative. 

 Try understanding the meaning of each option, before selecting the appropriate one. 

 Available options are given below : 

 1.Create 'training-dataset' from the images of known ->MELANOMA<- types!! 

 2.Train classifiers and regressors on the created 'training-dataset'!! 

 3.Create 'testing-dataset' from the supervised images in temp folder!! 

 4.Predict results from the 'testcase.npz' numpy file!! 

 5.Print 'feature-descriptors' of images strored in numpy files, 'dataset.npz' or 'testcase.npz'!! 

 6.Plot 'Classifier/Regressor' graphs!! 

 7.Add the 'feature-sets' to 'testcase.npz' or 'dataset.npz' numpy files, to make mlmodels more accurate!! 

 8.Print only the selected 'feature-sets' of an image!! 

 9.List files present in valid 'project-directories'!! 

 10.Get color plates of an image!! 

 Enter 'e' to exit!! 

Enter your choice - 1 If you see a 'results' folder in the root directory of the project, delete the 'dataset' folder in it.

Now, before you proceed, just make sure that you have your corresponding images in the 'images' folder under the 'malignant', 'benign' or 'negative' directories.

If you haven't already made the directories, please make them and place the corresponding images in them.

The image file-names must be numeric starting from 0 in sequence under each category folder.

Eg. - 0.jpg, 1.jpg, 2.jpg, ..... etc

You must provide images under each category!!!

Just press any key when your are ready : y Enter the number of images you placed under the 'images/malignant' directory - 1 Traceback (most recent call last): File "/home/usert/Downloads/Melanoma-Detection/Main.py", line 541, in main_menu() File "/home/usert/Downloads/Melanoma-Detection/Main.py", line 377, in main_menu createDataSet("malignant", int(input("Enter the number of images you placed under the \'images/malignant\' directory - \n"))) File "/home/usert/Downloads/Melanoma-Detection/Main.py", line 106, in createDataSet dset, featnames = (np.load('dataset.npz'))['dset'], (np.load('dataset.npz'))['featnames'] File "/usr/lib/python3/dist-packages/numpy/lib/npyio.py", line 253, in getitem return format.read_array(bytes, File "/usr/lib/python3/dist-packages/numpy/lib/format.py", line 727, in read_array raise ValueError("Object arrays cannot be loaded when " ValueError: Object arrays cannot be loaded when allow_pickle=False

do you have idea how to fix this?

Tejas07PSK commented 1 year ago

This code was implemented 5 years back, numpy library used to allow pickle files to be loaded on to memory by default. New numpy lib does not allow pickle by default. It's been a while I need to check the code.

Tejas07PSK commented 1 year ago

I have made the changes, please try now !! Let me know in case of any issues. Cheers ✌️

prassidicePM commented 1 year ago

hello,

I downloaded again your code, commented in Classyfier.py line 1

from sklearn.externals import joblib

and commented in mlmodels/DecisionSurfacePlotter.py line 5#from sklearn.externals import joblib

in order to have it working then this is the result:

====================================================== $ python3 Main.py ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^WELCOME TO THE MELANOMA-PREDICTION PROGRAM^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This is a nascent approach towards detecting Melanoma-Skin-Lesion, using OpenCV, NumPY, Matplotlib and SciKit in Python Programming Language.

This project utilizes some of the core concepts of 'DIGITAL IMAGE PROCESSING' & 'MACHINE LEARNING'.

This program can categorize the cancerous-lesion as Malignant, Benign or Negative.

Try understanding the meaning of each option, before selecting the appropriate one.

Available options are given below :

1.Create 'training-dataset' from the images of known ->MELANOMA<- types!!

2.Train classifiers and regressors on the created 'training-dataset'!!

3.Create 'testing-dataset' from the supervised images in temp folder!!

4.Predict results from the 'testcase.npz' numpy file!!

5.Print 'feature-descriptors' of images strored in numpy files, 'dataset.npz' or 'testcase.npz'!!

6.Plot 'Classifier/Regressor' graphs!!

7.Add the 'feature-sets' to 'testcase.npz' or 'dataset.npz' numpy files, to make mlmodels more accurate!!

8.Print only the selected 'feature-sets' of an image!!

9.List files present in valid 'project-directories'!!

10.Get color plates of an image!!

Enter 'e' to exit!!

Enter your choice - 1 If you see a 'results' folder in the root directory of the project, delete the 'dataset' folder in it.

Now, before you proceed, just make sure that you have your corresponding images in the 'images' folder under the 'malignant', 'benign' or 'negative' directories.

If you haven't already made the directories, please make them and place the corresponding images in them.

The image file-names must be numeric starting from 0 in sequence under each category folder.

Eg. - 0.jpg, 1.jpg, 2.jpg, ..... etc

You must provide images under each category!!!

Just press any key when your are ready : l Enter the number of images you placed under the 'images/malignant' directory - 10 ------------------+++++++++++++============FOR MALIGNANT SET==============++++++++++++++----------------------

------------------------------------------------------_

Iterating for image - 0

------------------------------------------------------_

Coarseness Calc-Time : 1171.998973 secs

Traceback (most recent call last): File "/home/prassidice/Downloads/Melanoma-Detection-master/Main.py", line 535, in main_menu() File "/home/prassidice/Downloads/Melanoma-Detection-master/Main.py", line 371, in main_menu createDataSet("malignant", int(input("Enter the number of images you placed under the \'images/malignant\' directory - \n"))) File "/home/prassidice/Downloads/Melanoma-Detection-master/Main.py", line 117, in createDataSet feobj3 = g.Gabor(obj.getSegGrayImg(), obj.getSegColImg()) File "/home/prassidice/Downloads/Melanoma-Detection-master/featext/physical/Gabor.py", line 10, in init self.__hierarchy = tup[2]IndexError: tuple index out of range

======================================================

so it is still not working

best regards, Prassidice ------- Original Message ------- Il sabato 11 marzo 2023 9:00 PM, Palash Sarkar @.***> ha scritto:

Closed #2 as completed.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Tejas07PSK commented 1 year ago

Looks like the OpenCV version you're using is much newer. I have made changes to the respective file (Gabor.py) mentioned in the error messages. Please try now and let me know if you're facing any other issue.

Tejas07PSK commented 1 year ago

Also please don't comment the sklearn imports, they are necessary for the program to run !! Joblib was once part of scikit now it has been made into a separate library. I have updated the dependency lists on README and have fixed the import statements for joblib in Classyfier.py and DecisionSurfacePlotter.py. Please install joblib via pip before proceeding.