Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def right_graph(axes, objectsY, objectsDist, path_save, where_save, path_for_graph, color_red, color_green):
- fig, ax = plt.subplots(axes, 1)
- fig.subplots_adjust(top = 0.9, wspace = 0, hspace = 0.6)
- j = 0
- if axes > 1:
- for i in ax:
- #gc.collect()
- i.set_xlim(0, 1)
- i.set_ylim(0, 400)
- i.tick_params(axis = 'both', which = 'major', labelsize = 7)
- for k in range(len(objectsDist[j])):
- if objectsDist[j][k] <= color_red:
- if objectsDist[j][k] <= color_green:
- i.scatter(1/(1 + math.log(objectsDist[j][k] + 1)), objectsY[j][k], marker = 'o', color = 'green', s = 30)
- j += 1
- i.set_title('Object #' + str(j))
- ax[-1].set_ylabel("HeigHt", fontsize=10)
- ax[-1].set_xlabel("Confidence", fontsize=10)
- else:
- ax.set_xlim(0, 1)
- ax.set_ylim(0, 400)
- ax.tick_params(axis = 'both', which = 'major', labelsize = 7)
- ax.set_ylabel("HeigHt", fontsize=10)
- ax.set_xlabel("Confidence", fontsize=10)
- for i in range(len(objectsDist[j])):
- #gc.collect()
- if objectsDist[j][i] <= color_red:
- if objectsDist[j][i] <= color_green:
- ax.scatter(1/(1 + math.log(objectsDist[j][i] + 1)), objectsY[j][i], marker = 'o', color = 'green', s = 30)
- j += 1
- ax.set_title('Object #' + str(j))
- set_size(1500/(96*4), 2000/(96*4))
- plt.savefig(where_save + path_for_graph + '/right/' + path_save + '.png', dpi = 200)
- graphic_final = cv2.imread(where_save + path_for_graph + '/right/' + path_save + '.png', cv2.IMREAD_COLOR)
- img = cv2.imread(where_save + path_for_graph + '/' + path_save + '.png', cv2.IMREAD_COLOR)
- graphic_final = cv2.resize(graphic_final, (1920,1780), interpolation = cv2.INTER_AREA)
- vis = np.concatenate((img, graphic_final), axis = 1)
- cv2.imwrite(where_save + path_for_graph + '/' + path_save + '.png', vis)
- plt.close(fig)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement