-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
25 lines (16 loc) · 589 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from detectron2.engine import DefaultPredictor
import os
import pickle
from utils import *
cfg_save_path = "IS_cfg.pickle"
with open(cfg_save_path, 'rb') as f:
cfg = pickle.load(f)
cfg.MODEL.WEIGHTS = os.path.join(cfg.OUTPUT_DIR, "model_final.pth") #load model weight path of custom dataset we trained
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5
predictor = DefaultPredictor(cfg)
image_path = "image_path"
on_image(image_path, predictor)
convex_hull(canny_path)
fill_boundary(convexhull_path)
transformations(opening_path, image_path)
#on_image1(image_path, predictor)