From c15ff805be5b2084bcf909ba1ab4638229de8985 Mon Sep 17 00:00:00 2001 From: Said Azizov <69383296+proton-bit@users.noreply.github.com> Date: Mon, 12 Dec 2022 14:33:04 +0300 Subject: [PATCH] preparing final solution! --- faster_rcnn/inference.py | 6 ++++-- requirements.txt | 3 ++- {yolov7 => yolo}/setup.py | 0 3 files changed, 6 insertions(+), 3 deletions(-) rename {yolov7 => yolo}/setup.py (100%) diff --git a/faster_rcnn/inference.py b/faster_rcnn/inference.py index 20e110a..f6235ad 100644 --- a/faster_rcnn/inference.py +++ b/faster_rcnn/inference.py @@ -30,9 +30,10 @@ cfg.merge_from_file(model_zoo.get_config_file("COCO-Detection/faster_rcnn_R_50_FPN_1x.yaml")) cfg.MODEL.WEIGHTS = "model_final.pth" # path to the model we just trained cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.001 # set a custom testing threshold - cfg.SOLVER.BASE_LR = 0.00025 + cfg.MODEL.DEVICE='cpu' cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE = 128 cfg.MODEL.ROI_HEADS.NUM_CLASSES = 1 + cfg.SOLVER.BASE_LR = 0.00025 predictor = DefaultPredictor(cfg) @@ -46,4 +47,5 @@ v.draw_text(str(box[:2].numpy()), tuple(box[:2].numpy())) v = v.get_output() img = v.get_image()[:, :, ::-1] - cv2.imwrite(args.path2save, img) \ No newline at end of file + cv2.imwrite(args.path2save, img) + print("output saved at: ", args.path2save) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 90f32a6..1d8b271 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ catboost +fvcore cpbd==1.0.7 imageio==2.9.0 matplotlib==3.2.2 @@ -13,4 +14,4 @@ skimage==0.0 tqdm==4.64.1 detectron2.egg==info torch==1.13.0+cu116 - +pyyaml==5.1 diff --git a/yolov7/setup.py b/yolo/setup.py similarity index 100% rename from yolov7/setup.py rename to yolo/setup.py