natanielruiz
2017-10-30 b217d495fed78e32e30a769307cd9eb7c2f65952
Almost done
3 文件已重命名
1个文件已修改
19 ■■■■ 已修改文件
code/test_hopenet.py 补丁 | 查看 | 原始文档 | blame | 历史
code/test_on_video.py 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
code/test_on_video_dockerface.py 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
code/train_hopenet.py 补丁 | 查看 | 原始文档 | blame | 历史
code/test_hopenet.py
code/test_on_video.py
@@ -27,6 +27,7 @@
    parser.add_argument('--bboxes', dest='bboxes', help='Bounding box annotations of frames')
    parser.add_argument('--output_string', dest='output_string', help='String appended to output file')
    parser.add_argument('--n_frames', dest='n_frames', help='Number of frames', type=int)
    parser.add_argument('--fps', dest='fps', help='Frames per second of source video', type=float, default=30.)
    args = parser.parse_args()
    return args
@@ -80,7 +81,7 @@
    # Define the codec and create VideoWriter object
    fourcc = cv2.VideoWriter_fourcc(*'MJPG')
    out = cv2.VideoWriter('output/video/output-%s.avi' % args.output_string, fourcc, 30.0, (width, height))
    out = cv2.VideoWriter('output/video/output-%s.avi' % args.output_string, fourcc, args.fps, (width, height))
    # # Old cv2
    # width = int(video.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH))   # float
@@ -118,7 +119,7 @@
                video.release()
                txt_out.close()
                sys.exit(0)
            out.write(frame)
            # out.write(frame)
            frame_num += 1
        # Start processing frame with bounding box
@@ -127,9 +128,8 @@
            break
        while True:
            x_min, y_min, x_max, y_max, conf = int(float(line[1])), int(float(line[2])), int(float(line[3])), int(float(line[4])), float(line[5])
            x_min, y_min, x_max, y_max = int(float(line[1])), int(float(line[2])), int(float(line[3])), int(float(line[4]))
            if conf > 0.98:
                bbox_width = abs(x_max - x_min)
                bbox_height = abs(y_max - y_min)
                # x_min -= 3 * bbox_width / 4
@@ -144,7 +144,7 @@
                y_min = max(y_min, 0)
                x_max = min(frame.shape[1], x_max)
                y_max = min(frame.shape[0], y_max)
                # Crop image
            # Crop face loosely
                img = frame[y_min:y_max,x_min:x_max]
                img = Image.fromarray(img)
code/test_on_video_dockerface.py
File was renamed from code/test_on_video_noconf.py
@@ -27,7 +27,7 @@
    parser.add_argument('--bboxes', dest='bboxes', help='Bounding box annotations of frames')
    parser.add_argument('--output_string', dest='output_string', help='String appended to output file')
    parser.add_argument('--n_frames', dest='n_frames', help='Number of frames', type=int)
    parser.add_argument('--fps', dest='fps', help='Frames per second of source video', type=float)
    parser.add_argument('--fps', dest='fps', help='Frames per second of source video', type=float, default=30.)
    args = parser.parse_args()
    return args
@@ -119,7 +119,7 @@
                video.release()
                txt_out.close()
                sys.exit(0)
            # out.write(frame)
            out.write(frame)
            frame_num += 1
        # Start processing frame with bounding box
@@ -128,8 +128,9 @@
            break
        while True:
            x_min, y_min, x_max, y_max = int(float(line[1])), int(float(line[2])), int(float(line[3])), int(float(line[4]))
            x_min, y_min, x_max, y_max, conf = int(float(line[1])), int(float(line[2])), int(float(line[3])), int(float(line[4])), float(line[5])
            if conf > 0.98:
            bbox_width = abs(x_max - x_min)
            bbox_height = abs(y_max - y_min)
            # x_min -= 3 * bbox_width / 4
@@ -144,7 +145,7 @@
            y_min = max(y_min, 0)
            x_max = min(frame.shape[1], x_max)
            y_max = min(frame.shape[0], y_max)
            # Crop face loosely
                # Crop image
            img = frame[y_min:y_max,x_min:x_max]
            img = Image.fromarray(img)
code/train_hopenet.py