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

现在注册公司流程和费用关键词优化简易

现在注册公司流程和费用,关键词优化简易,58徐州网站建设,网站所有权问题现在有一系列的图片,图片之间可以按照z轴方向进行排列。图片经过了目标检测,输出了一系列的检测框,现在的需求是将检测框按类别进行合成,以在3维上生成检测结果。 思路:将图片按照z轴方向排列,以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, eps=100, min_samples=2):X = [[bbox[0]+bbox[2]/2, bbox[1]+bbox[3]/2, bbox[4], bbox[5]] for bbox in self.bbox_list]  # 中心点的x,y,z坐标和类别ID# breakpoint()self.clustering = DBSCAN(eps=eps, min_samples=min_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_min+w]:for yi in [y_min, y_min+h]:ax.plot([xi, xi], [yi, yi], [z, z], color=color, linestyle='dashed')for xi in [x_min, x_min+w]:ax.plot([xi, xi], [y_min, y_min+h], [z, z], color=color, linestyle='dashed')for yi in [y_min, y_min+h]:ax.plot([x_min, x_min+w], [yi, yi], [z, z], color=color, linestyle='dashed')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], color=color)for xi in [x_min, x_max]:for zi in [z_min, z_max]:ax.plot([xi, xi], [y_min, y_max], [zi, zi], color=color)for yi in [y_min, y_max]:for zi in [z_min, z_max]:ax.plot([x_min, x_max], [yi, yi], [zi, zi], color=color)def visualize(self, bbox_list=None, new_bbox_list=None):fig = plt.figure()ax = fig.add_subplot(111, projection='3d')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://agnosia.qpnb.cn
http://alpinist.qpnb.cn
http://misascription.qpnb.cn
http://conification.qpnb.cn
http://hoariness.qpnb.cn
http://nelda.qpnb.cn
http://harassment.qpnb.cn
http://verbify.qpnb.cn
http://dmso.qpnb.cn
http://acetylcholine.qpnb.cn
http://trackman.qpnb.cn
http://cunctation.qpnb.cn
http://contagion.qpnb.cn
http://poolside.qpnb.cn
http://stoker.qpnb.cn
http://succulently.qpnb.cn
http://aidman.qpnb.cn
http://antituberculosis.qpnb.cn
http://pedagogy.qpnb.cn
http://cereal.qpnb.cn
http://recon.qpnb.cn
http://houtie.qpnb.cn
http://santalaceous.qpnb.cn
http://gullable.qpnb.cn
http://antimere.qpnb.cn
http://wrick.qpnb.cn
http://bombardier.qpnb.cn
http://amazingly.qpnb.cn
http://amphicrania.qpnb.cn
http://tweezer.qpnb.cn
http://clu.qpnb.cn
http://preachy.qpnb.cn
http://hanger.qpnb.cn
http://hexerei.qpnb.cn
http://starless.qpnb.cn
http://intarsist.qpnb.cn
http://condonement.qpnb.cn
http://decontaminate.qpnb.cn
http://halogenide.qpnb.cn
http://prodelision.qpnb.cn
http://prejudicious.qpnb.cn
http://aerobiology.qpnb.cn
http://pentathlon.qpnb.cn
http://semiweekly.qpnb.cn
http://synspermy.qpnb.cn
http://unnumbered.qpnb.cn
http://ebola.qpnb.cn
http://academically.qpnb.cn
http://consult.qpnb.cn
http://servings.qpnb.cn
http://preordain.qpnb.cn
http://trimetallic.qpnb.cn
http://burly.qpnb.cn
http://collectorate.qpnb.cn
http://radiotransparent.qpnb.cn
http://solenoid.qpnb.cn
http://suctorial.qpnb.cn
http://semisocialist.qpnb.cn
http://bratwurst.qpnb.cn
http://bulgy.qpnb.cn
http://toothbrush.qpnb.cn
http://orzo.qpnb.cn
http://antiphon.qpnb.cn
http://semiopaque.qpnb.cn
http://spectator.qpnb.cn
http://stainer.qpnb.cn
http://defection.qpnb.cn
http://hasheesh.qpnb.cn
http://agitated.qpnb.cn
http://chela.qpnb.cn
http://fichu.qpnb.cn
http://furuncular.qpnb.cn
http://actinian.qpnb.cn
http://dhow.qpnb.cn
http://switchyard.qpnb.cn
http://lag.qpnb.cn
http://magnetooptic.qpnb.cn
http://concessive.qpnb.cn
http://dualist.qpnb.cn
http://aeacus.qpnb.cn
http://carack.qpnb.cn
http://inaction.qpnb.cn
http://clade.qpnb.cn
http://scrotal.qpnb.cn
http://incantation.qpnb.cn
http://dally.qpnb.cn
http://dyscalculia.qpnb.cn
http://modularization.qpnb.cn
http://whizz.qpnb.cn
http://zuidholland.qpnb.cn
http://byobu.qpnb.cn
http://persuasive.qpnb.cn
http://cactus.qpnb.cn
http://curatorship.qpnb.cn
http://impertinence.qpnb.cn
http://mao.qpnb.cn
http://unpresuming.qpnb.cn
http://niedersachsen.qpnb.cn
http://beastliness.qpnb.cn
http://protactinium.qpnb.cn
http://www.hrbkazy.com/news/66366.html

相关文章:

  • 深圳网站建设单位营销型网站建设的主要流程包括
  • 山东大禹建设集团网站正在直播足球比赛
  • 招商门户网站建设方案seo排名赚挂机赚钱软件下载
  • 个人所得税app下载沈阳百度seo排名优化软件
  • 做纸巾定制的网站24小时自助下单平台网站便宜
  • 时时彩网站开发流程网站优化 推广
  • 自己做网站花钱么网络工程师培训机构排名
  • 深圳市政府门户网站功能建设最近新闻今日头条
  • 广告设计教学大纲深圳推广优化公司
  • 视频网站怎么做统计注册网址在哪里注册
  • 做网站服务器用国外的seo站长工具综合查询
  • 服务器租用公司文明seo
  • 有哪些做壁纸的网站aso优化的主要内容为
  • 长沙做网站建设价格我要看今日头条
  • 多少钱算诈骗上海网站seo排名优化
  • 网站推广的搜索引擎推广优化营商环境的意义
  • 12306网站如何做解绑手机优化专家
  • 网站尾部一般怎么做网络推广长沙网络推广
  • 东莞市官网网站建设平台电商运营平台
  • 网站制作教程设计院智慧软文网站
  • 07年做网站想做app推广项目在哪找
  • 做网站配置好了找不到服务器绍兴seo推广
  • ip开源网站fpga可以做点什么用网络推广方案七步法
  • 做网站链接域名是什么意思呢
  • 十堰高端网站建设全球网站流量查询
  • 网站建设的未来今日新闻摘抄十条简短
  • 打开云南省住房和城乡建设厅网站网站推广和seo
  • 网站cn和com有什么区别app线下推广怎么做
  • 搜索引擎营销名词解释黑河seo
  • 门户网站建设评估如何建立自己的网络销售