From 71d654057f484049aa1ce2b8cdb3f5b201202465 Mon Sep 17 00:00:00 2001 From: Dragos Bobolea Date: Mon, 23 Sep 2019 00:05:06 +0300 Subject: [PATCH] read bounding boxes from file --- bounding_box_helpers.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bounding_box_helpers.py b/bounding_box_helpers.py index e69de29..9e9cd4b 100644 --- a/bounding_box_helpers.py +++ b/bounding_box_helpers.py @@ -0,0 +1,11 @@ +import os +import numpy as np + + +def load_bounding_boxes(filepath): + with open(filepath,'r') as f: + text = f.read() + lines = text.split('\n') + boxes = np.array([line.split('\t')[:4] for line in lines if line],dtype=np.int32) + + return boxes \ No newline at end of file