当前位置: 首页 > news >正文

做网站一定要效果图吗discuz论坛门户网站模板

做网站一定要效果图吗,discuz论坛门户网站模板,品牌网站建设价格,钦北区网站建设现在有一系列的图片#xff0c;图片之间可以按照z轴方向进行排列。图片经过了目标检测#xff0c;输出了一系列的检测框#xff0c;现在的需求是将检测框按类别进行合成#xff0c;以在3维上生成检测结果。 思路#xff1a;将图片按照z轴方向排列#xff0c;以z轴索引作…现在有一系列的图片图片之间可以按照z轴方向进行排列。图片经过了目标检测输出了一系列的检测框现在的需求是将检测框按类别进行合成以在3维上生成检测结果。 思路将图片按照z轴方向排列以z轴索引作为检测框的z值。等同于输入为x, y, w, h, z, class_id可以计算得到每个检测框的中心点来标定这个框x_center, y_center, z, class_id。 然后可以通过聚类算法在4维空间上进行聚类最后取出聚类出的每一类的点的xyz的最大值与最小值和class_id来生成聚类结果[x_min, y_min, z_min, x_max, y_max, z_max, class_id]。 代码展示 from sklearn.cluster import DBSCAN import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as npclass BBoxClusterv3:def __init__(self, bbox_list):self.bbox_list bbox_listself.clustering None# self.color_map plt.cm.get_cmap(hsv, len(set([bbox[5] for bbox in bbox_list])))def cluster(self, eps100, min_samples2):X [[bbox[0]bbox[2]/2, bbox[1]bbox[3]/2, bbox[4], bbox[5]] for bbox in self.bbox_list] # 中心点的xyz坐标和类别ID# breakpoint()self.clustering DBSCAN(epseps, min_samplesmin_samples).fit(X)def get_new_bbox_list(self):# self.cluster()labels self.clustering.labels_print(聚类出的类别,labels)new_bbox_list []for label in set(labels):if label ! -1: # Ignore noiseidxs np.where(labels label)[0]print(每一类的bboxes索引: ,idxs)bboxes np.array(self.bbox_list)[idxs]print(每一类的bboxes集合: ,bboxes)x_min np.min(bboxes[:, 0])y_min np.min(bboxes[:, 1])x_max np.max(bboxes[:, 0] bboxes[:, 2])y_max np.max(bboxes[:, 1] bboxes[:, 3])z_min np.min(bboxes[:, 4])z_max np.max(bboxes[:, 4])class_id bboxes[0, 5]new_bbox_list.append([x_min, y_min, z_min, x_max, y_max, z_max, class_id])return new_bbox_listdef draw_bbox_2d(self, bbox, ax):x_min, y_min, w, h, z, class_id bboxcolor self.color_map(class_id)# print(color)for xi in [x_min, x_minw]:for yi in [y_min, y_minh]:ax.plot([xi, xi], [yi, yi], [z, z], colorcolor, linestyledashed)for xi in [x_min, x_minw]:ax.plot([xi, xi], [y_min, y_minh], [z, z], colorcolor, linestyledashed)for yi in [y_min, y_minh]:ax.plot([x_min, x_minw], [yi, yi], [z, z], colorcolor, linestyledashed)def draw_bbox_3d(self, bbox, ax):x_min, y_min, z_min, x_max, y_max, z_max, class_id bboxcolor self.color_map(class_id)for xi in [x_min, x_max]:for yi in [y_min, y_max]:ax.plot([xi, xi], [yi, yi], [z_min, z_max], colorcolor)for xi in [x_min, x_max]:for zi in [z_min, z_max]:ax.plot([xi, xi], [y_min, y_max], [zi, zi], colorcolor)for yi in [y_min, y_max]:for zi in [z_min, z_max]:ax.plot([x_min, x_max], [yi, yi], [zi, zi], colorcolor)def visualize(self, bbox_listNone, new_bbox_listNone):fig plt.figure()ax fig.add_subplot(111, projection3d)for bbox in bbox_list:self.draw_bbox_2d(bbox, ax)for bbox in new_bbox_list:self.draw_bbox_3d(bbox, ax)plt.show()def draw(self):new_bbox_list self.get_new_bbox_list()print(bbox_list,new_bbox_list)self.visualize(bbox_list, new_bbox_list)def color_map(self, class_id):# 假设这里使用映射字典将类别 ID 映射到不同的颜色color_mapping {0: red, 1: blue, 2: green}return color_mapping.get(class_id, black) # 默认为黑色if __name__ __main__:bbox_list [#-------------------------##[x, y, w, h, z, class_id]##-------------------------#[100, 200, 50, 50, 0, 0],[110, 210, 50, 50, 1, 0],[120, 220, 50, 50, 2, 0],[130, 230, 50, 50, 3, 0],[140, 240, 50, 50, 4, 0],[200, 300, 60, 60, 0, 1],[210, 310, 60, 60, 1, 1],[220, 320, 60, 60, 2, 1],[300, 400, 70, 70, 6, 0],[310, 410, 70, 70, 7, 0],[320, 420, 70, 70, 8, 0],[400, 500, 80, 80, 9, 1],[410, 510, 80, 80, 10, 1],[420, 520, 80, 80, 11, 2]]bbox_cluster BBoxClusterv3(bbox_list)bbox_cluster.cluster()bbox_cluster.draw()假如有以下几类框 最终聚类效果
http://www.yutouwan.com/news/144846/

相关文章:

  • 电子商务网站建设与课程设计淘宝服务商平台
  • 网站开发和app的区别百度站长工具seo
  • 电大的网站界面ui设计训练怎么做银川市做网站的公司
  • 绵阳安州区做网站的有哪些网站建设申请方案文样
  • 个人网站能干嘛未备案 网站加速
  • 网站域名优化做网站流量的方法
  • 下载网站模板怎么使用教程毕业设计可以做哪些网站
  • 网站建设培训业务心得cms系统干什么的
  • 定制型网站一般价格家装设计师培训要多久
  • 阿里云服务器挂游戏seo推广赚钱
  • 如何提高网站优化网店代运营公司方案
  • 2017年网站建设高职考f卷百度关键词推广条件
  • 网址自动生成手机网站织梦开发供需网站
  • 阿里云静态网站托管如何让wordpress主页不显示文章
  • 网站栏目描述怎么写官网查询网站
  • 杭州便宜的手机网站建设wordpress好玩的主题
  • 创建网站大约多少钱2018wordpress 标签 取消
  • 艾科斗少儿编程加盟长春做网站公司长春seo公司
  • 建设云企业服务平台网站怎么自己优化
  • 合肥网站开发 合肥网站优化网站开发导航
  • 网站建设文化效果用wordpress建站多少钱
  • 邯郸网站建设的企业网站建设平台源码
  • 南阳网站建设推广wordpress2017
  • 织梦 商城网站做宣传图片的网站
  • 中小企业网站建设服务做爰网站下载地址
  • 建材网站制作全国最大的机械设备采购平台
  • 建设网站网站名手机网站建设技术
  • 网站带支付模板sql网站开发
  • 博罗网站设计网络设计方法有哪些
  • 冠县做网站化工行业网站