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

建设网站需要的配置wordpress qq主题下载

建设网站需要的配置,wordpress qq主题下载,互联网推广营销,15 企业网站优化方案有哪些内容注#xff1a;.题中附录并没有给出苹果的标签集#xff0c;所以需要我们自己通过前4问得到训练的标签集#xff0c;采用的是yolov5 7.0 版本#xff0c;该版本带分割功能 一#xff1a;关于数据集的制作#xff1a; clc; close all; clear; %-----这个是生成yolov5 数据… 注.题中附录并没有给出苹果的标签集所以需要我们自己通过前4问得到训练的标签集采用的是yolov5 7.0 版本该版本带分割功能 一关于数据集的制作 clc; close all; clear; %-----这个是生成yolov5 数据集的-------- % 图像文件夹路径 folder_path E:/新建文件夹/yatai/Attachment/Apple/; % 图像文件列表 image_files dir(fullfile(folder_path, *.jpg)); % 假设所有图片都是jpg格式% 解析文件名中的数字并转换为数值类型 numbers cellfun((x) sscanf(x, %d.jpg), {image_files.name});% 根据解析出的数字对文件列表进行排序 [~, sorted_idx] sort(numbers); image_files image_files(sorted_idx); % 存储每张图片苹果数量的数组 apple_counts zeros(length(image_files), 1);% 存储每张图片的平均成熟度评分 average_red_intensity_ratio_per_image zeros(length(image_files), 1);% 确保输出文件夹存在 output_folder E:\新建文件夹\yatai\Attachment\Attachment 2\APPlemasktxt; if ~exist(output_folder, dir)mkdir(output_folder); end% 存储每张图片的平均苹果质量评分 average_quality_scores_per_image zeros(length(image_files), 1); % 遍历每张图片 for i 1: length(image_files) %2 % 读取图像img imread(fullfile(folder_path, image_files(i).name));·······省略了部分代码% 给分割的对象标记不同的标签labelled_img bwlabel(binary_img); % figure; % 在原始图像上绘制分割结果 % imshow(img); % hold on;colors[b g r c m y];for k 1:length(unique(labelled_img)) - 1boundary bwboundaries(labelled_img k);for b 1:length(boundary)plot(boundary{b}(:,2), boundary{b}(:,1), colors(mod(k,length(colors))1), LineWidth, 2);endend% title(Segmented Apples);% hold off;% 计数分割后的苹果number_of_apples max(labelled_img(:));disp([Number of segmented apples: , num2str(number_of_apples)]);apple_counts(i) number_of_apples;% 打印当前图片的苹果数量fprintf(Image %d (%s): %d apples detected.\n, i, image_files(i).name, number_of_apples);%下面是制作分割的数据集% 给分割的对象标记不同的标签labelled_img bwlabel(binary_img);% 准备写入YOLOv5格式的分割轮廓点文件% 根据图像文件名创建对应的txt文件名baseFileName sprintf(%d.txt, i);txt_filename fullfile(output_folder, baseFileName);fileID fopen(txt_filename, w);% 确保文件已成功打开if fileID -1error(Cannot open file %s for writing., txt_filename);end% 获取图像尺寸img_height size(img, 1);img_width size(img, 2);% 遍历每个苹果写入轮廓点信息for k 1:max(labelled_img(:))[B,~] bwboundaries(labelled_img k, noholes);contours B{1}; % 取第一组轮廓点% 检查contours的尺寸if size(contours, 2) 2 % 确保contours有两列% 转换为归一化坐标contours_normalized contours ./ [img_height, img_width];% 写入文件fprintf(fileID, 0 ); % 假设苹果的类别ID为0for p 1:size(contours_normalized, 1) % fprintf(Plotting point at (%f, %f)\n, contours_normalized(p, 2), contours_normalized(p, 1)); % 调试信息fprintf(fileID, %f %f , contours_normalized(p, 2), contours_normalized(p, 1));endfprintf(fileID, \n);elsewarning(Contour for apple %d in image %d does not have correct dimensions., k, i);endendfclose(fileID);end 二关于yolov5 7.0 的训练 我的电脑是3080 训练了20轮测试下面就是部分测试的结果 下面是关于数据集的划分代码  Descripttion: split_img.py version: 1.0 Author: UniDome Date: 2022-04-20 16:28:45 LastEditors: UniDome LastEditTime: 2022-04-20 16:39:56import os, shutil, random from tqdm import tqdmdef split_img(img_path, label_path, split_list):try: # 创建数据集文件夹Data E:/新建文件夹/yatai/Attachment/Attachment 2/outputos.mkdir(Data)train_img_dir Data /images/trainval_img_dir Data /images/valtest_img_dir Data /images/testtrain_label_dir Data /labels/trainval_label_dir Data /labels/valtest_label_dir Data /labels/test# 创建文件夹os.makedirs(train_img_dir)os.makedirs(train_label_dir)os.makedirs(val_img_dir)os.makedirs(val_label_dir)os.makedirs(test_img_dir)os.makedirs(test_label_dir)except:print(文件目录已存在)train, val, test split_listall_img os.listdir(img_path)all_img_path [os.path.join(img_path, img) for img in all_img]# all_label os.listdir(label_path)# all_label_path [os.path.join(label_path, label) for label in all_label]train_img random.sample(all_img_path, int(train * len(all_img_path)))train_img_copy [os.path.join(train_img_dir, img.split(\\)[-1]) for img in train_img]train_label [toLabelPath(img, label_path) for img in train_img]train_label_copy [os.path.join(train_label_dir, label.split(\\)[-1]) for label in train_label]for i in tqdm(range(len(train_img)), desctrain , ncols80, unitimg):_copy(train_img[i], train_img_dir)_copy(train_label[i], train_label_dir)all_img_path.remove(train_img[i])val_img random.sample(all_img_path, int(val / (val test) * len(all_img_path)))val_label [toLabelPath(img, label_path) for img in val_img]for i in tqdm(range(len(val_img)), descval , ncols80, unitimg):_copy(val_img[i], val_img_dir)_copy(val_label[i], val_label_dir)all_img_path.remove(val_img[i])test_img all_img_pathtest_label [toLabelPath(img, label_path) for img in test_img]for i in tqdm(range(len(test_img)), desctest , ncols80, unitimg):_copy(test_img[i], test_img_dir)_copy(test_label[i], test_label_dir)def _copy(from_path, to_path):shutil.copy(from_path, to_path)def toLabelPath(img_path, label_path):img img_path.split(\\)[-1]label img.split(.jpg)[0] .txtreturn os.path.join(label_path, label)def main():img_path rE:\新建文件夹\yatai\Attachment\Applelabel_path rE:\新建文件夹\yatai\Attachment\Attachment 2\APPlemasktxtsplit_list [0.7, 0.2, 0.1] # 数据集划分比例[train:val:test]split_img(img_path, label_path, split_list)if __name__ __main__:main() A题详细代码数据集https://docs.qq.com/doc/DZHh5ckNrWlNybFNs
http://www.zqtcl.cn/news/984524/

相关文章:

  • 深圳网站建设新闻网站建设营销的企业
  • 建筑设计网站软件排名工具
  • wordpress theme珠宝最适合seo的网站源码
  • 建设工程规划许可证查询网站畜牧业网站模板
  • 做网站大概要多少钱页面网站缓存如何做
  • 家电网站建设需求分析朔州网络推广
  • 陕西交通建设集团网站体检网络营销中自建网站
  • 做游戏的php网站有哪些微信商城是什么
  • wordpress memcached redux深圳网站优化方法
  • 移动商城 网站建设方法方式韩国导航地图app
  • 企业网站源码是什么瑞安企业做网站
  • 佛山深圳建网站wordpress 段代码
  • 网站备案 强制仿牌网站容易被攻击吗
  • 网站做访问追踪js特效演示网站
  • 建设网站女装名字大全宝宝投票网站怎么做
  • 江苏省建设厅网站首页天津百度网站排名优化
  • 织梦网络设计工作室网站模板镇江市精神文明建设网站
  • 网站管理工具装修公司设计软件有哪些
  • 招标网站的服务费怎么做分录什么网站做玩具的比较多
  • 青海省住房建设厅网站WordPress主题启用出现错误
  • 自己怎么建网站网站的seo 如何优化
  • 博客网站模板下载如何自学美工
  • 哪个免费建站好专业seo要多少钱
  • 做3d建模贴图找哪个网站珠海建设网站公司简介
  • 网站开发过程前端后端qq刷赞网站咋做
  • 湘潭高新区建设局网站旅游做攻略的网站有哪些
  • wordpress网站云备份网站模块插件是怎么做的
  • 郑州市城乡建设规划网站深圳十佳设计公司排名
  • 上海建设项目环保验收公示网站两新支部网站建设
  • 网站开发移动端网络系统软件应用与维护