Exemplo n.º 1
0
def run():
    detector = PeopleDetector()

    frame = cv2.imread("9.png")

    detected_points = detector.detect(frame, debug=True, degree=10)

    # Extend to rectangle
    for p in detected_points:
        p.append(10)
        p.append(10)

    PeopleDetector.draw_detections(frame, detected_points, 3)
    cv2.imshow("test", frame)
    cv2.waitKey(0)
Exemplo n.º 2
0
class PeopleEvidence:
    def __init__(self):
        # People detector
        self.people_detector = PeopleDetector()

    def get_evidence(self, frame):
        people_squares = self.people_detector.detect(frame, degree=30)

        rows, cols = frame.shape[0], frame.shape[1]
        boundary = [[0, 0], [rows, 0], [rows, cols], [0, rows]]

        evidence = Evidence(boundary, PEOPLE_SENSOR, BOOLEAN_STATES, BOOLEAN_STATES[0])

        # Square to evidence
        for square in people_squares:
            evidence.add_detection(BOOLEAN_STATES[1], square)

        return evidence
Exemplo n.º 3
0
 def __init__(self):
     # People detector
     self.people_detector = PeopleDetector()
Exemplo n.º 4
0
from people_detector import PeopleDetector
from utils import user_input, data

if __name__ == "__main__":
    args = user_input.parse_arguments()
    if not args.filenames:
        filenames = data.get_filenames(args.data_dir)
    else:
        filenames = [f.strip() for f in args.filenames.split(",")]

    people_detector = PeopleDetector(args.yolo_config_path)
    people_detector.detect(filenames, args.data_dir, args.results_dir)