Comments (4)
To help you debug this, can you please provide the following information?
- What dataset are you using?
- How are you preprocessing the data?
- What are your classification tasks?
- How are you generating the class prompts?
from gloria.
- I'm using the Chexpert 5X200 dataset
- I have used the "Zeroshot classification for CheXpert5x200" script from your Readme file without additional preproccesing.
The only change I made in the "Zeroshot classification for CheXpert5x200" was the generation of the chexpert 5X200 data set using your function preprocess_chexpert_5X200_data from gloria.datasets.preprocess_datasets . - The classification task is the same as your classification task on chexpert 5X200, classification of each image into on of the 5 classes.
- As part of using your script I am generating the class_prompts using your function generate_chexpert_class_prompts
Thank you for your answer!
from gloria.
Got it, thanks for the info. May I ask how you are computing the results? Using different random seeds I was still able to get an accuracy of 60+
labels = df[gloria.constants.CHEXPERT_COMPETITION_TASKS].to_numpy().argmax(axis=1)
pred = similarities[gloria.constants.CHEXPERT_COMPETITION_TASKS].to_numpy().argmax(axis=1)
acc = len(labels[labels == pred]) / len(labels)
print(acc) # 0.607
from gloria.
The following is the code I used, I tried to replace the results calculation to the one you suggested but I get the same results. The only thing that I think I'm doing different than you is that I take only 200 images every run because of my GPU memory capacity.
import torch
import gloria
import pandas as pd
from gloria.datasets.preprocess_datasets import preprocess_chexpert_5x200_data
df = preprocess_chexpert_5x200_data()
df = df[0:200]
# load model
device = "cuda" if torch.cuda.is_available() else "cpu"
gloria_model = gloria.load_gloria(device=device)
cls_prompts = gloria.generate_chexpert_class_prompts()
# process input images and class prompts
processed_txt = gloria_model.process_class_prompts(cls_prompts, device)
processed_imgs = gloria_model.process_img(df['Path'].tolist(), device)
# zero-shot classification on 1000 images
similarities = gloria.zero_shot_classification(
gloria_model, processed_imgs, processed_txt)
labels = df[gloria.constants.CHEXPERT_COMPETITION_TASKS].to_numpy().argmax(axis=1)
pred = similarities[gloria.constants.CHEXPERT_COMPETITION_TASKS].to_numpy().argmax(axis=1)
acc = len(labels[labels == pred]) / len(labels) #0.17
from gloria.
Related Issues (20)
- No such file or directory: '/gloria/CheXpert-v1.0/master_updated.csv' HOT 2
- Reproduced results on RSNA Pneumonia dataset HOT 1
- The reported results of RSNA dataset HOT 1
- PneumothoraxImageDataset for segmentation HOT 4
- In the segmentation task, EncodedPixels seems to have an extra space, which I remove, but... HOT 15
- pretrained code HOT 21
- how to load those saved models to continue training HOT 1
- Finetuned model for segmentation? HOT 1
- text prompts for RSNA dataset HOT 1
- image text Retriver HOT 1
- Some questions about the similarities? HOT 2
- Hello, if I don't have the file "master_updated. csv", how can I reproduce your experiment? Can you give me this file? Otherwise, the code won't run. HOT 1
- Does the CheXpert dataset include reports now? HOT 2
- Can not download the pretrained model HOT 5
- Hello, I can't find chexpert_8x200.csv HOT 1
- RuntimeError: grad can be implicitly created only for scalar outputs
- Large CPU usage rate
- Considerations for cheXpert 5*200?
- Pretrain with MIMIC-CXR Val Loss HOT 3
- pip install failed HOT 7
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 gloria.