You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am implementing code of XREM paper in which one file uses the "CXR-Report-Metric" whose code look like this below:
"
import pandas as pd
import argparse
#CXR-Metric computes the scores based on 2,192 samples from the mimic-cxr test set that consists of 3,678
#This function selects the respective 2,192 reports
def main(fpath, opath):
df = pd.read_csv(fpath)
test = pd.read_csv('../data/mimic_test_impressions.csv')
gt = pd.read_csv('../data/cxr2_generated_appa.csv')[['dicom_id', 'study_id']] #contains the dicom ids of the 2,192 imgs
gt['report'] = [None] * len(gt)
pred = df['filtered']
pred = pd.concat([test[['dicom_id']], pred], axis = 1)
pred = pred.set_index('dicom_id')
for idx, row in gt.iterrows():
dicom_id, study_id, _ = row
gt['report'][idx] = pred['filtered'][dicom_id]
gt.to_csv(opath, index = False)
if name == 'main':
parser = argparse.ArgumentParser()
parser.add_argument('--fpath', default='../ifcc/example_m2trans_nli.csv')
parser.add_argument('--opath', default='pred.csv')
args = parser.parse_args()
main(args.fpath, args.opath)
I am not sure here what file to pass here in 'gt' variable. Is it ground truth files with labels? If yes then it doesn't contain study_id and dicom_id. Can you explain this what gt files look like any sample of gt file. @KathyFeiyang any lead will be highly appreciated.
The text was updated successfully, but these errors were encountered:
I am implementing code of XREM paper in which one file uses the "CXR-Report-Metric" whose code look like this below:
"
import pandas as pd
import argparse
#CXR-Metric computes the scores based on 2,192 samples from the mimic-cxr test set that consists of 3,678
#This function selects the respective 2,192 reports
def main(fpath, opath):
df = pd.read_csv(fpath)
test = pd.read_csv('../data/mimic_test_impressions.csv')
gt = pd.read_csv('../data/cxr2_generated_appa.csv')[['dicom_id', 'study_id']] #contains the dicom ids of the 2,192 imgs
gt['report'] = [None] * len(gt)
pred = df['filtered']
pred = pd.concat([test[['dicom_id']], pred], axis = 1)
pred = pred.set_index('dicom_id')
for idx, row in gt.iterrows():
dicom_id, study_id, _ = row
gt['report'][idx] = pred['filtered'][dicom_id]
gt.to_csv(opath, index = False)
if name == 'main':
parser = argparse.ArgumentParser()
parser.add_argument('--fpath', default='../ifcc/example_m2trans_nli.csv')
parser.add_argument('--opath', default='pred.csv')
args = parser.parse_args()
main(args.fpath, args.opath)
The text was updated successfully, but these errors were encountered: