Commit aed5c9bb authored by Marius Laska's avatar Marius Laska
Browse files

final bbox implementation

parent 45ef92b4
from il_pipeline.pipeline import Pipeline
from il_pipeline.utility.storable import Storable
import numpy as np
import matplotlib.pyplot as plt
from pkg_resources import resource_filename
from sklearn import linear_model
from base.floor_plan_plot import FloorPlanPlotRec
from sklearn.metrics import mean_squared_error, r2_score
import seaborn as sns
from analysis.visualize_learning_progress import convert_from_grid
def main():
#pipe_c: Pipeline = Storable.load("evaluation/gia/cmp/output/CIRCLE")
pipe_c: Pipeline = Storable.load("../evaluation/lohan/evaluation/grid/output/BBOX")
#pipe_c: Pipeline = Storable.load("evaluation/lohan/full_cmp/output/QUANTILE")
#pipe_c: Pipeline = Storable.load("evaluation/lohan/full_cmp/output/QUANTILE")
pipe_r: Pipeline = Storable.load("../evaluation/lohan/evaluation/grid/output/REG")
convert_from_grid(pipe_c)
# for fold_idx in range(pipe_c.data_provider.num_splits):
# pipe_c.summary.y_true_labels[fold_idx][:, 0] = 200 - \
# pipe_c.summary.y_true_labels[
# fold_idx][:, 0]
# pipe_c.summary.y_true_labels[fold_idx][:, 1] = 80 - \
# pipe_c.summary.y_true_labels[
# fold_idx][:, 1]
# pipe_c.summary.y_pred[fold_idx][:, 0] = 200 - \
# pipe_c.summary.y_pred[
# fold_idx][:, 0]
# pipe_c.summary.y_pred[fold_idx][:, 1] = 80 - \
# pipe_c.summary.y_pred[
# fold_idx][:, 1]
#y_pred = np.concatenate(pipe_r.summary.y_pred, axis=0)
#y_true = np.concatenate(pipe_r.summary.y_true_labels, axis=0)
y_pred = np.concatenate(pipe_c.summary.y_pred, axis=0)[:, :2]
y_true = np.concatenate(pipe_c.summary.y_true_labels, axis=0)
y_pred_reg = np.concatenate(pipe_r.summary.y_pred, axis=0)
error = np.linalg.norm(y_pred - y_true, axis=1)
sub_mask = np.where(error < 60)[0]
error = error[sub_mask]
circle_size = np.prod(np.concatenate(pipe_c.summary.y_pred, axis=0)[:, 2:], axis=1)
#circle_size = get_size_for_quantile(pipe_c)
circle_size = circle_size[sub_mask]
plt.scatter(error, circle_size)
# Create linear regression object
regr = linear_model.LinearRegression()
# Train the model using the training sets
regr.fit(error.reshape(-1, 1), circle_size.reshape(-1, 1))
# Make predictions using the testing set
y_val = regr.predict(error.reshape(-1, 1))
plt.plot(error, y_val)
# The coefficients
print('Coefficients: \n', regr.coef_)
# The mean squared error
print('Mean squared error: %.2f'
% mean_squared_error(circle_size, y_val))
# The coefficient of determination: 1 is perfect prediction
print('Coefficient of determination: %.2f'
% r2_score(circle_size, y_val))
plt.show()
sns.kdeplot(error, circle_size, shade = True, cmap = "PuBu")
plt.show()
img = "evaluation/gia/gia_floor_4.jpg"
img = resource_filename('data', 'lohan/CrowdsourcedDS1floor.png')
fp_dims = (83.32, 17.16)
fp_dims = (200, 80)
fp = FloorPlanPlotRec(fp_dims, 20, floorplan_bg_img=img)
fp.draw_error_scatter(y_true, 12, color="b") #np.full(circle_size.shape, 5.7)
fp.draw_error_scatter(y_true, error,
color="r") # np.full(circle_size.shape, 5.7)
#fp.draw_error_scatter(y_true, error, color="r")
fp.show_plot()
def get_size_for_quantile(pipe: Pipeline):
y_pred = np.concatenate(pipe.summary.y_pred, axis=0)
max_x = np.max(y_pred[:, [0, 2]], axis=1)
min_x = np.min(y_pred[:, [0, 2]], axis=1)
max_y = np.max(y_pred[:, [1, 3]], axis=1)
min_y = np.min(y_pred[:, [1, 3]], axis=1)
diff_x = max_x - min_x
diff_y = max_y - min_y
size = np.multiply((max_y - min_y), (max_x - min_x))
return size
if __name__ == "__main__":
main()
\ No newline at end of file
from il_pipeline.pipeline import Pipeline
from il_pipeline.utility.storable import Storable
import numpy as np
import math
from base.floor_plan_plot import FloorPlanPlotRec
from analysis.plot_analysis import find_radius_for_acc
PI = 3.14159265359
def main():
pipe: Pipeline = Storable.load("evaluation/gia/cmp/output/CIRCLE")
b_pipe: Pipeline = Storable.load("evaluation/UJIndoorLoc/circle/b0/f1/output/BBOX")
p_reg: Pipeline = Storable.load("evaluation/UJIndoorLoc/circle/b0/f1/output/REG")
pipe: Pipeline = Storable.load("evaluation/gia/cmp/output/CIRCLE")
p_reg: Pipeline = Storable.load("evaluation/gia/cmp/output/REG")
print("-------CIRCLE------- \n")
# calc success rate
success, c_dist = get_success_rate(pipe)
print("ACC: {}".format(success))
print("CENTER_DIST: {}".format(c_dist))
# get avg size
size = get_avg_circle_size(pipe)
print("SIZE: {}".format(size))
dist_out, dist_in = get_dist_from_circles(centers=np.concatenate(pipe.summary.y_pred, axis=0)[:, :2],
radius=np.concatenate(pipe.summary.y_pred, axis=0)[:, 2],
y_true=np.concatenate(pipe.summary.y_true_labels, axis=0))
print("DEVIATION: out: {}, in: {}".format(dist_out, dist_in))
#
# print("--------BOX--------- \n")
# y_true = np.concatenate(b_pipe.summary.y_true_labels, axis=0)
# y_pred = np.concatenate(b_pipe.summary.y_pred, axis=0)
#
# acc, wrong_mask = calc_acc_c(y_true, y_pred)
# print("acc: {}".format(acc))
# print("center-dist: {}".format(center_diff(y_true, y_pred)))
# print("avg_center: {}".format(np.mean(y_pred[:, :2], axis=0)))
# print("avg_box_size: {}".format(get_avg_box_size(b_pipe)))
#
# dist = get_dist_from_box(b_pipe)
# print("DEVIATION: {}".format(dist))
print("--------REG--------- \n")
# comparison to REG
radius_c = find_radius_for_acc(p_reg, accuracy=0.9147)
print("SIZE_REG (CIRCLE): {}".format(PI * math.pow(radius_c, 2)))
radius_b = find_radius_for_acc(p_reg, accuracy=0.9)
print("SIZE_REG (CIRCLE): {}".format(PI * math.pow(radius_b, 2)))
dist_out, dist_in = get_dist_from_circles(
centers=np.concatenate(p_reg.summary.y_pred, axis=0)[:, :2],
radius=radius_c,
y_true=np.concatenate(p_reg.summary.y_true_labels, axis=0))
print("DEVIATION(circle): out: {}, in: {}".format(dist_out, dist_in))
dist_out, dist_in = get_dist_from_circles(
centers=np.concatenate(p_reg.summary.y_pred, axis=0)[:, :2],
radius=radius_b,
y_true=np.concatenate(p_reg.summary.y_true_labels, axis=0))
print("DEVIATION(box): out: {}, in: {}".format(dist_out, dist_in))
# visualize
visualize(pipe, p_reg, b_pipe)
def get_dist_from_box(pipe: Pipeline):
y_true = np.concatenate(pipe.summary.y_true_labels, axis=0)
y_pred = np.concatenate(pipe.summary.y_pred, axis=0)
diff_x = np.abs(y_true[:, 0] - y_pred[:, 0]) - y_pred[:, 2]/2
diff_y = np.abs(y_true[:, 1] - y_pred[:, 1]) - y_pred[:, 3]/2
diff_x = np.maximum(np.zeros_like(diff_x), diff_x)
diff_y = np.maximum(np.zeros_like(diff_y), diff_y)
dist = np.sqrt(np.square(diff_x) + np.square(diff_y))
return np.mean(dist)
def get_dist_from_circles(centers, radius, y_true):
diff = np.linalg.norm(centers - y_true, axis=1) - radius
dist_out = np.maximum(np.zeros_like(diff), diff)
#dist_out = np.max(diff)
dist_in = np.minimum(np.zeros_like(diff), diff) / radius
return np.mean(dist_out), np.mean(dist_in)
def get_avg_circle_size(pipe: Pipeline):
y_pred = np.concatenate(pipe.summary.y_pred, axis=0)
size = np.mean(PI * np.power(y_pred[:, 2], 2))
return size
def get_success_rate(pipe: Pipeline):
y_true = np.concatenate(pipe.summary.y_true_labels, axis=0)
y_pred = np.concatenate(pipe.summary.y_pred, axis=0)
diff = np.linalg.norm(y_pred[:, :2] - y_true, axis=1)
correct_idx = np.where(diff <= y_pred[:, 2])[0]
return len(correct_idx)/len(y_true), np.mean(diff)
def visualize(pipe: Pipeline, p_reg: Pipeline, p_box: Pipeline):
y_true = np.concatenate(pipe.summary.y_true_labels, axis=0)
y_pred = np.concatenate(pipe.summary.y_pred, axis=0)
y_pred_reg = np.concatenate(p_reg.summary.y_pred, axis=0)
y_pred_box = np.concatenate(p_box.summary.y_pred, axis=0)
max_el = len(y_true)
img = "evaluation/gia/gia_floor_4.jpg"
# fp = FloorPlanPlotRec((83.32, 17.16), 20, floorplan_bg_img=img)
#plot_data_heatmap(pipe, floor_plotter=fp)
for idx in range(max_el):
idx += 0
fp = FloorPlanPlotRec((83.32, 17.16), 2, floorplan_bg_img=img)
fp.draw_points(y_true[idx, 0], y_true[idx, 1], color='g', alpha=0.5)
# box_size = y_pred[:]
fp.draw_circles(centers=y_pred[idx, :2], radius=y_pred[idx, 2], color='r')
fp.draw_circles(centers=y_pred_reg[idx, :2], radius=3.9849, color='b')
fp.draw_rectangles_new(anchors=y_pred_box[idx, :])
fp.show_plot()
if __name__ == "__main__":
main()
\ No newline at end of file
from il_pipeline.pipeline import Pipeline
from il_pipeline.utility.storable import Storable
import numpy as np
import math
from pkg_resources import resource_filename
from analysis.evaluate_circle import get_success_rate, get_avg_circle_size, \
get_dist_from_circles, get_dist_from_box
from analysis.visualize_learning_progress import convert_from_grid, \
convert_from_2dim_grid
from base.floor_plan_plot import FloorPlanPlotRec
from main import calc_acc_c, center_diff
from analysis.plot_analysis import find_radius_for_acc, get_avg_box_size
from analysis.visualize_quantile import get_acc_and_size
PI = 3.14159265359
def main():
p_reg: Pipeline = Storable.load("../evaluation/gia/evaluation/grid/output/REG_2")
p_circle: Pipeline = None#Storable.load("evaluation/lohan/full_cmp/output/CIRCLE")
p_quantile: Pipeline = None#Storable.load("evaluation/lohan/full_cmp/output/QUANTILE")
p_box: Pipeline = Storable.load("../evaluation/gia/evaluation/grid/output/BBOX_2")#"evaluation/lohan/scaled_output_2/output/BBOX") # Storable.load("evaluation/gia/full_cmp/output/BBOX")
fp_dims = (83.32, 17.16)
#convert_from_2dim_grid(p_box, grid_size=20)
convert_from_grid(p_box)
# for fold_idx in range(p_box.data_provider.num_splits):
# p_box.summary.y_true_labels[fold_idx][:, 0] *= fp_dims[0]
# p_box.summary.y_true_labels[fold_idx][:, 1] *= fp_dims[1]
#
# p_box.summary.y_pred[fold_idx][:, [0, 2]] *= fp_dims[0]
# p_box.summary.y_pred[fold_idx][:, [1, 3]] *= fp_dims[1]
# for fold_idx in range(p_box.data_provider.num_splits):
#
# p_box.summary.y_true_labels[fold_idx][:] = p_box.summary.y_true_labels[fold_idx][:] + np.array([95.333, 29.612])
# p_box.summary.y_pred[fold_idx][:, :2] = p_box.summary.y_pred[
# fold_idx][:, :2] + np.array(
# [95.333, 29.612])
# p_box.summary.y_true_labels[fold_idx][:, 0] = 200 - \
# p_box.summary.y_true_labels[
# fold_idx][:, 0]
# p_box.summary.y_true_labels[fold_idx][:, 1] = 80 - \
# p_box.summary.y_true_labels[
# fold_idx][:, 1]
# p_box.summary.y_pred[fold_idx][:, 0] = 200 - \
# p_box.summary.y_pred[
# fold_idx][:, 0]
# p_box.summary.y_pred[fold_idx][:, 1] = 80 - \
# p_box.summary.y_pred[
# fold_idx][:, 1]
if p_circle is not None:
print("\n -------CIRCLE------- \n")
# calc success rate
success, c_dist = get_success_rate(p_circle)
print("ACC: {}".format(success))
print("CENTER_DIST: {}".format(c_dist))
# get avg size
size = get_avg_circle_size(p_circle)
print("SIZE: {}".format(size))
dist_out, dist_in = get_dist_from_circles(
centers=np.concatenate(p_circle.summary.y_pred, axis=0)[:, :2],
radius=np.concatenate(p_circle.summary.y_pred, axis=0)[:, 2],
y_true=np.concatenate(p_circle.summary.y_true_labels, axis=0))
print("DEVIATION: out: {}, in: {}".format(dist_out, dist_in))
if p_box is not None:
print("\n --------BOX--------- \n")
y_true = np.concatenate(p_box.summary.y_true_labels, axis=0)
y_pred = np.concatenate(p_box.summary.y_pred, axis=0)
acc_box, wrong_mask = calc_acc_c(y_true, y_pred)
print("acc: {}".format(acc_box))
print("center-dist: {}".format(center_diff(y_true, y_pred)))
print("avg_center: {}".format(np.mean(y_pred[:, :2], axis=0)))
print("avg_box_size: {}".format(get_avg_box_size(p_box)))
dist = get_dist_from_box(p_box)
print("DEVIATION: {}".format(dist))
if p_quantile is not None:
print("\n ------QUANTILE------- \n")
y_true = np.concatenate(p_quantile.summary.y_true_labels, axis=0)
y_pred = np.concatenate(p_quantile.summary.y_pred, axis=0)
acc_quantile, size = get_acc_and_size(p_quantile)
print("acc: {}".format(acc_quantile))
#print("center-dist: {}".format(center_diff(y_true, y_pred)))
#print("avg_center: {}".format(np.mean(y_pred[:, :2], axis=0)))
print("avg_box_size: {}".format(size))
if p_reg is not None:
print("\n --------REG--------- \n")
y_true = np.concatenate(p_reg.summary.y_true_labels, axis=0)
y_pred = np.concatenate(p_reg.summary.y_pred, axis=0)
print("center-dist: {}".format(center_diff(y_true, y_pred)))
# comparison to REG
#radius_c = find_radius_for_acc(p_reg, accuracy=success)
#print("SIZE_REG (CIRCLE): {}".format(PI * math.pow(radius_c, 2)))
radius_b = find_radius_for_acc(p_reg, accuracy=acc_box)
print("SIZE_REG (BOX): {}".format(PI * math.pow(radius_b, 2)))
#radius_b = find_radius_for_acc(p_reg, accuracy=acc_quantile)
#print("SIZE_REG (QUANTILE): {}".format(PI * math.pow(radius_b, 2)))
visualize(p_reg, p_circle, p_quantile, p_box)
def visualize(p_reg: Pipeline=None, p_circle: Pipeline=None, p_quantile: Pipeline=None, p_box: Pipeline=None):
img = "../evaluation/gia/gia_floor_4.jpg"
fp_dims = (83.32, 17.16)
#img = resource_filename('data', 'lohan/CrowdsourcedDS1floor.png')
#fp_dims = (200, 80)
#fp = FloorPlanPlotRec((83.32, 17.16), 20, floorplan_bg_img=img)
# plot_data_heatmap(pipe, floor_plotter=fp)
if p_reg is not None:
y_pred_reg = np.concatenate(p_reg.summary.y_pred, axis=0)
y_true = np.concatenate(p_reg.summary.y_true_labels, axis=0)
if p_circle is not None:
y_pred_circle = np.concatenate(p_circle.summary.y_pred, axis=0)
y_true = np.concatenate(p_circle.summary.y_true_labels, axis=0)
if p_quantile is not None:
y_pred_quantile = np.concatenate(p_quantile.summary.y_pred, axis=0)
y_true = np.concatenate(p_quantile.summary.y_true_labels, axis=0)
if p_box is not None:
y_pred_box = np.concatenate(p_box.summary.y_pred, axis=0)
y_true = np.concatenate(p_box.summary.y_true_labels, axis=0)
#mask = np.where(np.logical_and(y_pred_box[:, 0] >= y_pred_box[:, 0], y_pred_box[:, 2] < y_pred_box[:, 3]))[0]
# y_pred_box[:, 2:] = np.abs(y_pred_box[:, 2:])
# mask = np.where(np.logical_and(np.greater_equal(y_pred_box[:, 3], y_pred_box[:, 3]), y_true[:, 0] >= 150))[0]
#y_true = y_true[mask]
#y_pred_box = y_pred_box[mask]
for (train, test) in p_box.data_provider.splits_indices:
fp = FloorPlanPlotRec(fp_dims, 2, floorplan_bg_img=img)
fp.draw_points(p_box.data_provider.labels[train, 0], p_box.data_provider.labels[train, 1], color='g', alpha=0.5)
fp.draw_points(p_box.data_provider.labels[test, 0],
p_box.data_provider.labels[test, 1], color='r',
alpha=0.5)
fp.show_plot()
#fp = FloorPlanPlotRec(fp_dims, 2, floorplan_bg_img=img)
for idx in range(len(y_true)):#len(y_true)):
idx += 0
fp = FloorPlanPlotRec(fp_dims, 2, floorplan_bg_img=img)
fp.draw_points(y_true[idx, 0], y_true[idx, 1], color='g', alpha=0.5)
# box_size = y_pred[:]
if p_circle is not None:
fp.draw_circles(centers=y_pred_circle[idx, :2], radius=y_pred_circle[idx, 2], color='r')
if p_reg is not None:
fp.draw_circles(centers=y_pred_reg[idx, :2], radius=4.7243, color='b')
if p_quantile is not None:
fp.draw_points(y_pred_quantile[idx, 0], y_pred_quantile[idx, 1], color="r")
fp.draw_points(y_pred_quantile[idx, 2], y_pred_quantile[idx, 3],
color="b")
fp.draw_rectangles(anchors=y_pred_quantile[idx, :], color="g")
if p_box is not None:
fp.draw_rectangles_new(anchors=y_pred_box[idx, :], color='black')
fp.show_plot()
if __name__ == "__main__":
main()
\ No newline at end of file
......@@ -5,6 +5,7 @@ import numpy as np
import math
from shapely.geometry import box
PI = 3.14159265359
def area_size_LDCE():
pipe: Pipeline = Storable.load("/home/laskama/Dropbox/PhD/evaluation/revision/lohan_CDF/fine/output/DNN(deep)")
......@@ -26,8 +27,8 @@ def area_size_LDCE():
def plot():
box_pipe: Pipeline = Storable.load("/home/laskama/PycharmProjects/bboxPrediction/evaluation/lohan_cmp/output/BBOX")
point_pipe: Pipeline = Storable.load("/home/laskama/PycharmProjects/bboxPrediction/evaluation/lohan_cmp/output/DNN")
box_pipe: Pipeline = Storable.load("evaluation/UJIndoorLoc/box/b1/f1/output/BBOX")
point_pipe: Pipeline = Storable.load("evaluation/UJIndoorLoc/box/b1/f1/output/REG")
box_acc, _ = calc_acc_c(np.concatenate(box_pipe.summary.y_true_labels, axis=0), np.concatenate(box_pipe.summary.y_pred, axis=0))
box_center_error = center_diff(np.concatenate(box_pipe.summary.y_true_labels, axis=0), np.concatenate(box_pipe.summary.y_pred, axis=0))
......@@ -38,8 +39,9 @@ def plot():
point_error = np.mean(np.linalg.norm(np.concatenate(point_pipe.summary.y_true_labels, axis=0) - np.concatenate(point_pipe.summary.y_pred, axis=0), axis=1))
print(point_error)
radius = find_radius_for_acc(point_pipe, accuracy=0.993)
print(2 * 3.14 * math.pow(radius, 2))
radius = find_radius_for_acc(point_pipe, accuracy=0.8)
print(PI * math.pow(radius, 2))
def get_radius_acc(model: Pipeline, radius):
y_true = np.concatenate(model.summary.y_true_labels, axis=0)
......@@ -50,6 +52,18 @@ def get_radius_acc(model: Pipeline, radius):
return len(inside) / len(y_true)
# def get_radius_acc_train(model: Pipeline, radius):
# y_true = np.concatenate(model.summary.y_true_labels, axis=0)
# y_pred = np.concatenate(model.summary.y_pred, axis=0)
#
# _, y_train = model.data_provider.get_train_data(split_idx=0)
# _, y_pred = model.
#
# dist = np.linalg.norm(y_true - y_pred, axis=1)
# inside = np.where(dist < radius)[0]
#
# return len(inside) / len(y_true)
def get_avg_box_size(model: Pipeline):
y_pred = np.concatenate(model.summary.y_pred, axis=0)
......@@ -57,17 +71,24 @@ def get_avg_box_size(model: Pipeline):
return np.mean(y_pred[:, 2] * y_pred[:, 3])
def find_radius_for_acc(model: Pipeline, step_size=.5, accuracy=1):
def find_radius_for_acc(model: Pipeline, step_size=.0001, accuracy=1):
acc = 0
radius = 0
while acc < accuracy:
radius += step_size
acc = get_radius_acc(model, radius)
print("Radius: {}, ACC: {}".format(radius, acc))
print("Radius: {}, ACC: {}".format(radius, acc))
return radius
if __name__ == "__main__":
area_size_LDCE()
#plot()
\ No newline at end of file
# pipe: Pipeline = Storable.load("evaluation/UJIndoorLoc/box/output/REG")
# print(np.mean(np.linalg.norm(np.concatenate(pipe.summary.y_true_labels,
# axis=0) - np.concatenate(
# pipe.summary.y_pred, axis=0), axis=1)))
#
# find_radius_for_acc(pipe, accuracy=0.76)
#area_size_LDCE()
plot()
\ No newline at end of file
from il_pipeline.pipeline import Pipeline
from il_pipeline.utility.storable import Storable
import numpy as np
from pkg_resources import resource_filename
from main import calc_acc_c, center_diff
from analysis.visualize_quantile import get_acc_and_size
def main():
pipe: Pipeline = Storable.load("evaluation/lohan/scale/output/BBOX")
\ No newline at end of file
from il_pipeline.pipeline import Pipeline
from il_pipeline.utility.storable import Storable
from pkg_resources import resource_filename
import numpy as np
from bbox_pipeline import BboxPipeline
from floor_plan_plot import FloorPlanPlotRec
from base.bbox_pipeline import BboxPipeline
from base.floor_plan_plot import FloorPlanPlotRec
from main import calc_acc_c, center_diff
from plot_analysis import get_avg_box_size
from analysis.plot_analysis import get_avg_box_size
from il_pipeline.plotting.pipeline_plots import plot_data_heatmap
def main():
#file = "/home/laskama/PycharmProjects/bboxPrediction/evaluation/lohan_pretrain/output/BBOX"
file = "/home/laskama/PycharmProjects/bboxPrediction/evaluation/gia/pretrain/output/BBOX"
file = "/home/laskama/PycharmProjects/bboxPrediction/evaluation/gia/pretrain/box/output/BBOX"
#file = "/home/laskama/PycharmProjects/bboxPrediction/evaluation/gia/pretrain/output/BBOX"
file = "evaluation/gia/evaluation/box/no_pre/output/BBOX"
file = "evaluation/UJIndoorLoc/box/output/BBOX"
#file = "evaluation/UJIndoorLoc/box/b1/f1/output/BBOX"
for epoch in [1]:#,2,3,4,5]:
......@@ -29,6 +30,11 @@ def main():
print("center-dist: {}".format(center_diff(y_true, y_pred)))
print("avg_center: {}".format(np.mean(y_pred[:, :2], axis=0)))
print("avg_box_size: {}".format(get_avg_box_size(pipe)))
print("std-w: {}".format(np.std(pipe.summary.y_pred[0][:, 2])))
print("std-h: {}".format(np.std(pipe.summary.y_pred[0][:, 3])))
print("mean-w: {}".format(np.mean(pipe.summary.y_pred[0][:, 2])))
print("mean-h: {}".format(np.mean(pipe.summary.y_pred[0][:, 3])))
# for idx in range(10):
max_el = len(y_true)
# fp = FloorPlanPlotRec((83.32, 17.16), 2, floorplan_bg_img=img)
......@@ -49,17 +55,19 @@ def main():
# alpha=0.5)
# fp.show_plot()
# fp = FloorPlanPlotRec((83.32, 17.16), 2, floorplan_bg_img=img)
for idx in wrong_mask:
fp = FloorPlanPlotRec((83.32, 17.16), 20, floorplan_bg_img=img)
plot_data_heatmap(pipe, floor_plotter=fp)
for idx in range(max_el):
idx += 0
fp = FloorPlanPlotRec((83.32, 17.16), 2, floorplan_bg_img=img)
# fp = FloorPlanPlotRec((83.32, 17.16), 2, floorplan_bg_img=img)
fp.draw_points(y_true[idx, 0], y_true[idx, 1], color='g', alpha=0.5)
# box_size = y_pred[:]
fp.draw_rectangles_new(y_pred[idx, :])
fp.show_plot()
fp.show_plot()