Skip to content

Commit

Permalink
Cleaned up after reimage of metadata cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
DrJPepper committed Nov 14, 2022
1 parent e5ef5e4 commit fa37ac2
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion check_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def init_model():
# was 5 when I trained current model so has to stay 5 unless retrained
cfg.MODEL.ROI_HEADS.NUM_CLASSES = 5
cfg.MODEL.WEIGHTS = os.path.join(
cfg.OUTPUT_DIR, "model_final.pth.ocr")
cfg.OUTPUT_DIR, "model_final_ocr.pth")
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.3
predictor = DefaultPredictor(cfg)
return predictor
Expand Down
4 changes: 0 additions & 4 deletions config/training_data.json.ocr

This file was deleted.

4 changes: 0 additions & 4 deletions config/training_data.json.orig

This file was deleted.

File renamed without changes.
3 changes: 3 additions & 0 deletions config/training_data_ocr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"inhs_images_smaller/": ["1_labels.json"]
}
File renamed without changes.
6 changes: 3 additions & 3 deletions train_model_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def visualize_input(metadata, count):

def main():
prefix = open('config/overall_prefix.txt').readlines()[0].strip()
conf = json.load(open('config/training_data.json'))
conf = json.load(open('config/training_data_ocr.json'))
metadata = None # Need it in outer block for reuse
train = []
test_images = f'{prefix}full_imgs/'
test_images = f'{prefix}inhs_images_smaller/'

for img_dir in conf.keys():
ims = f'{prefix}{img_dir}'
Expand Down Expand Up @@ -77,7 +77,7 @@ def main():
trainer.resume_or_load(resume=True)
trainer.train()

cfg.MODEL.WEIGHTS = os.path.join(cfg.OUTPUT_DIR, "enhance_model_final.pth")
cfg.MODEL.WEIGHTS = os.path.join(cfg.OUTPUT_DIR, "ocr_model_NEW.pth")
# set the testing threshold for this model
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.1
predictor = DefaultPredictor(cfg)
Expand Down

0 comments on commit fa37ac2

Please sign in to comment.