Comments (1)
@Mahanteshambi, big apologies for not noticing your request in time.
Actually you just needed to add one line which rescales an image from uint8
[0, 255] scale to float
[0, 1] scale of intensities:
im = np.array(Image.open(img_path))
im = im[0:, 40:]
print(im.shape)
im = cv2.resize(im, (256,256))
im = im.astype(np.float64) / 255.0
print(im.shape)
plt.imshow(im), plt.show()
im = np.expand_dims(im, axis=0)
im = tf_to_th_encoding(im)
prediction = (model.predict(im)[0, 0]).astype(np.float64)
plt.imshow(prediction, cmap=plt.cm.Greys_r), plt.show()
This way it works fine for me.
Also, it's necessary to add CLAHE im = skimage.exposure.equalize_adapthist(im)
right after the rescaling line im = im.astype(np.float64) / 255.0
in order to reproduce exactly the same results, since model expects images only after CLAHE was performed on them.
from optic-nerve-cnn.
Related Issues (16)
- Pre-processing HOT 4
- what version of keras and tf did you use please? HOT 3
- RuntimeError: `get_session` is not available when using TensorFlow 2.0. HOT 3
- How do I use the pre-trained model to run on my own Images. HOT 6
- Not an issue but a question. (Joint optic cup disc hdf5) HOT 1
- Just a question, I am using your method to detect glaucoma, which needs calculating CDR value HOT 1
- hey can you help me if i only want to test only in single input image? HOT 1
- one question
- sir h5f = h5py.File(os.path.join(os.path.dirname(os.getcwd()), 'data', 'hdf5_datasets', 'all_data.hdf5'), 'r+') for this how to create HDF5 file . I am unable to create. HOT 4
- Unable to replicate HOT 2
- This is only segmenting the cup HOT 1
- RIM_ONE_v3.hdf5 and all_data.hdf5 need how to generate it HOT 6
- Hdf5 HOT 1
- Problem in Hdf5 creation HOT 1
- Crop dataset by optic disc? HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from optic-nerve-cnn.