update chexbert
Browse files- CheXbert/src/label.py +2 -1
- CheXbert/src/utils.py +2 -1
- inference.py +6 -6
CheXbert/src/label.py
CHANGED
|
@@ -9,7 +9,8 @@ from weights_utils import get_weight
|
|
| 9 |
|
| 10 |
# sys.path.append(os.path.abspath('/home/gholipos-admin/Desktop/Thesis/Training_Code/Entity_Summarization/CheXbert/src'))
|
| 11 |
|
| 12 |
-
import utils
|
|
|
|
| 13 |
from models.bert_labeler import bert_labeler
|
| 14 |
from bert_tokenizer import tokenize
|
| 15 |
from transformers import BertTokenizer
|
|
|
|
| 9 |
|
| 10 |
# sys.path.append(os.path.abspath('/home/gholipos-admin/Desktop/Thesis/Training_Code/Entity_Summarization/CheXbert/src'))
|
| 11 |
|
| 12 |
+
from . import utils
|
| 13 |
+
# import utils
|
| 14 |
from models.bert_labeler import bert_labeler
|
| 15 |
from bert_tokenizer import tokenize
|
| 16 |
from transformers import BertTokenizer
|
CheXbert/src/utils.py
CHANGED
|
@@ -4,7 +4,8 @@ import torch.nn as nn
|
|
| 4 |
import pandas as pd
|
| 5 |
import numpy as np
|
| 6 |
import json
|
| 7 |
-
from models.bert_labeler import bert_labeler
|
|
|
|
| 8 |
from bert_tokenizer import tokenize
|
| 9 |
from sklearn.metrics import f1_score, confusion_matrix
|
| 10 |
from statsmodels.stats.inter_rater import cohens_kappa
|
|
|
|
| 4 |
import pandas as pd
|
| 5 |
import numpy as np
|
| 6 |
import json
|
| 7 |
+
# from models.bert_labeler import bert_labeler
|
| 8 |
+
from .models.bert_labeler import bert_labeler
|
| 9 |
from bert_tokenizer import tokenize
|
| 10 |
from sklearn.metrics import f1_score, confusion_matrix
|
| 11 |
from statsmodels.stats.inter_rater import cohens_kappa
|
inference.py
CHANGED
|
@@ -13,13 +13,13 @@ import sys, os
|
|
| 13 |
# ---------------------------------------------------------------------
|
| 14 |
# Make CheXbert's `src` folder importable (so `import utils` works)
|
| 15 |
# ---------------------------------------------------------------------
|
| 16 |
-
BASE_DIR = os.path.dirname(__file__)
|
| 17 |
-
CHEXBERT_SRC = os.path.join(BASE_DIR, "CheXbert", "src")
|
| 18 |
|
| 19 |
-
if CHEXBERT_SRC not in sys.path:
|
| 20 |
-
|
| 21 |
|
| 22 |
-
from label import label # now imports /app/CheXbert/src/label.py
|
| 23 |
import pandas as pd
|
| 24 |
import numpy as np
|
| 25 |
import time
|
|
@@ -116,7 +116,7 @@ from DETR.arguments import get_args_parser as get_detr_args_parser
|
|
| 116 |
from VG import localization
|
| 117 |
from ssim import ssim
|
| 118 |
|
| 119 |
-
|
| 120 |
|
| 121 |
def get_args_parser():
|
| 122 |
parser = argparse.ArgumentParser('Set the Input', add_help=True)
|
|
|
|
| 13 |
# ---------------------------------------------------------------------
|
| 14 |
# Make CheXbert's `src` folder importable (so `import utils` works)
|
| 15 |
# ---------------------------------------------------------------------
|
| 16 |
+
# BASE_DIR = os.path.dirname(__file__)
|
| 17 |
+
# CHEXBERT_SRC = os.path.join(BASE_DIR, "CheXbert", "src")
|
| 18 |
|
| 19 |
+
# if CHEXBERT_SRC not in sys.path:
|
| 20 |
+
# sys.path.insert(0, CHEXBERT_SRC)
|
| 21 |
|
| 22 |
+
# from label import label # now imports /app/CheXbert/src/label.py
|
| 23 |
import pandas as pd
|
| 24 |
import numpy as np
|
| 25 |
import time
|
|
|
|
| 116 |
from VG import localization
|
| 117 |
from ssim import ssim
|
| 118 |
|
| 119 |
+
from CheXbert.src.label import label
|
| 120 |
|
| 121 |
def get_args_parser():
|
| 122 |
parser = argparse.ArgumentParser('Set the Input', add_help=True)
|