EasyCV icon indicating copy to clipboard operation
EasyCV copied to clipboard

refactor detection predictor

Open tuofeilunhifi opened this issue 2 years ago • 0 comments

Motivation

The use of unified DetectionPredictor for detection test and predictor.

For example:

  1. for detection test
        model_path = '.pth'
        config_path = '.py'
        img = './demo.jpg'
        out_file = './result.jpg'
        detector = DetectionPredictor(model_path, config_path)
        output = detector.predict(img)
        detector.visualize(img, output, out_file=out_file)
  1. for detection predictor
        model_path = '.pth'
        # config_path = '.py'   # remove config_path   
        img = './demo.jpg'
        out_file = './result.jpg'
        detector = DetectionPredictor(model_path)
        output = detector.predict(img)
        detector.visualize(img, output, out_file=out_file)

tuofeilunhifi avatar Aug 11 '22 09:08 tuofeilunhifi