Comments (6)
I just tried with two random images from MIMIC and the outputs change with scripts/process_image.py:
$ python3 process_image.py mimic/s50752076/90c22043-e189c0ff-6fb7432e-fe2dbddd-6e254412.jpg
{'preds': {'Atelectasis': 0.8238672,
'Cardiomegaly': 0.7937068,
'Consolidation': 0.6639328,
'Edema': 0.64718884,
'Effusion': 0.8994624,
'Emphysema': 0.34765577,
'Enlarged Cardiomediastinum': 0.6454991,
'Fibrosis': 0.3462754,
'Fracture': 0.54863507,
'Hernia': 0.10696117,
'Infiltration': 0.60848004,
'Lung Lesion': 0.5194453,
'Lung Opacity': 0.7979231,
'Mass': 0.51675844,
'Nodule': 0.43947062,
'Pleural_Thickening': 0.39090982,
'Pneumonia': 0.5910077,
'Pneumothorax': 0.52356243}}
BFLY-C02G10AMML7H-MBP:scripts ieee8023$ python3 process_image.py mimic/s50752076/a5b86009-73d89547-016407ee-f7d9a239-9bbc4465.jpg
{'preds': {'Atelectasis': 0.78038526,
'Cardiomegaly': 0.72883594,
'Consolidation': 0.67473954,
'Edema': 0.64642406,
'Effusion': 0.82089716,
'Emphysema': 0.51148427,
'Enlarged Cardiomediastinum': 0.61464787,
'Fibrosis': 0.5282905,
'Fracture': 0.55740416,
'Hernia': 0.10064988,
'Infiltration': 0.57235926,
'Lung Lesion': 0.5776483,
'Lung Opacity': 0.77271074,
'Mass': 0.54339457,
'Nodule': 0.51708037,
'Pleural_Thickening': 0.52615666,
'Pneumonia': 0.55208266,
'Pneumothorax': 0.5493742}}
Potentially you are not scaling the images to between [-1024, 1024] ?
from torchxrayvision.
I think we should probably issue a warning if the input images are not scaled correctly (by ensuring there are values outside the range [-1,255]). I've mainly just been afraid of slowing down performance but I think we can only check on the first batch and it won't hurt performance for batch processing.
from torchxrayvision.
When I answered I just removed the [0, 1] scaling at the end of the pre-processing leading to [0, 255] scaling and could see differences in output already. I rescaled to [-1024, 1024] later using the xrv.datasets.normalize(img, 255)
function and it works fine, thank you.
from torchxrayvision.
Thank you for your reply. I used the ToTensor()
transform from torchvision, which scales between [0,1]. I changed the scaling to [0,255] and I can confirm your output. Should've read the paper...
from torchxrayvision.
I changed the scaling to [0,255]
@mohkoh19 do you mean to ran the code xrv.datasets.normalize(img, 255)
? The correct scaling range is [-1024, 1024]. The 255 in that function call indicates it will take an 8-bit image (with values 0-255) and scale it up.
from torchxrayvision.
The feature discussed is now released in https://github.com/mlmed/torchxrayvision/releases/tag/0.0.37 !
from torchxrayvision.
Related Issues (20)
- extract 14class for mimic-crx HOT 3
- what is difference between weights="densenet121-res224-mimic_ch" and weights="densenet121-res224-mimic_nb" HOT 3
- not match between CheX_Dataset and model with weights="densenet121-res224-chex" HOT 9
- Example notebook doesn't work and has poor results when fixed HOT 5
- Any dataset tool to transform original big .jpg into small one HOT 2
- Example Results with Pretrained Autoencoder HOT 4
- Console always prints dataset statistics HOT 5
- Process_image return data? HOT 10
- Clarification regarding NaN labels and model output dimensions HOT 4
- Do you have models trained and/or evaluated on Chest ImaGenome? HOT 6
- Upload weights to TorchXrayVision github HOT 16
- CXR image quality assessment dataset HOT 3
- Error when loading NIH data set HOT 2
- DICOM to X-Ray PNG HOT 13
- Error loading PadChest dataset HOT 4
- Why I'm getting different results for the same image? HOT 7
- Merge and Align dataset labels HOT 13
- Confusion about input image format HOT 3
- autoencoder input size HOT 4
- How to get binary scores? HOT 2
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 torchxrayvision.