Commit 461c0cc0 authored by mihaivanea's avatar mihaivanea
Browse files

Change the labelled array to Nx4, rather than Nx1x1x4

parent b6de3606
......@@ -20,5 +20,7 @@ model.compile(
fddb_path_train = "../fddb/FDDB-folds/FDDB-fold-01-ellipseList.txt"
x_train, y_train = load_arrays_fddb(fddb_path_train)
print(x_train.shape)
print(y_train.shape)
model.fit(x_train, y_train)
......@@ -22,15 +22,16 @@ def convert_to_cartesian(ellip_array):
minor_r = float(ellip[1])
c_x = float(ellip[3])
c_y = float(ellip[4])
x1 = c_x - minor_r
y1 = c_y - major_r
x2 = c_x + minor_r
y2 = c_y + major_r
box = [round(p, 4) for p in (x1, y1, x2, y2)]
cartesian_output.append(box)
break
cartesian_output = np.array(cartesian_output)
return cartesian_output
x1 = round(c_x - minor_r, 4)
y1 = round(c_y - major_r, 4)
x2 = round(c_x + minor_r, 4)
y2 = round(c_y + major_r, 4)
#box = [round(p, 4) for p in (x1, y1, x2, y2)]
#cartesian_output.append(box)
#break
#cartesian_output = np.array(cartesian_output)
#return cartesian_output
return x1, y1, x2, y2
def generate_arrays_fddb(path):
no_labels, labels = (l for l in benchmark.tokenise(path))
......@@ -58,7 +59,7 @@ def load_arrays_fddb(path):
if len(data.shape) == 3:
x.append(data)
result = convert_to_cartesian(lb[2])
y.append([result])
y.append(result)
x = np.array(x)
y = np.array(y)
return x, y
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment