from detector import ObjectDetector
import numpy as np
import argparse

ap = argparse.ArgumentParser()
ap.add_argument("-a",
                "--annotations",
                required=True,
                help="path to saved annotations...")
ap.add_argument("-i",
                "--images",
                required=True,
                help="path to saved image paths...")
ap.add_argument("-d",
                "--detector",
                default=None,
                help="path to save the trained detector...")
args = vars(ap.parse_args())

print("[INFO] loading annotations and images")
annots = np.load(args["annotations"])
imagePaths = np.load(args["images"])

detector = ObjectDetector()
print("[INFO] creating & saving object detector")

detector.fit(imagePaths, annots, visualize=False, savePath=args["detector"])
Ejemplo n.º 2
0
parse.add_argument("-i",
                   "--images",
                   help="Path to saved images",
                   default="train_images.npy")
parse.add_argument("-d",
                   "--detector",
                   help="Path to save model",
                   default="svm_model.svm")
parse.add_argument("-ta",
                   "--test_annotate",
                   help="Path to saved test boxes annotations",
                   default="test_annot.npy")
parse.add_argument("-tim",
                   "--test_images",
                   help="Path to test images",
                   default="test_images.npy")
args = vars(parse.parse_args())

annots = np.load(args["annotations"])
imagePaths = np.load(args["images"])
trainAnnot = np.load(args["test_annotate"])
trainImages = np.load(args["test_images"])

detector = ObjectDetector()
detector.fit(imagePaths,
             annots,
             trainAnnot,
             trainImages,
             visualize=True,
             savePath=args["detector"])
Ejemplo n.º 3
0
from detector import ObjectDetector
import numpy as np
import argparse

ap = argparse.ArgumentParser()
ap.add_argument("-a", "--annotations", required=True, default='annot.npy', help="path to saved annotations...")
ap.add_argument("-i", "--images", required=True, default='images.npy', help="path to saved image paths...")
ap.add_argument("-d", "--detector", default='detector.svm',  help="path to save the trained detector...")
args = vars(ap.parse_args())

print "[INFO] loading annotations and images"
annotations = np.load(args["annotations"])
image_paths = np.load(args["images"])

detector = ObjectDetector()
print "[INFO] creating & saving object detector"

detector.fit(image_paths, annotations, visualize=True, save_path=args["detector"])