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

电子商务平台网站建设wordpress新闻模板下载

电子商务平台网站建设,wordpress新闻模板下载,有什么做设计的兼职网站,网站的访问量统计怎么做注#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.yutouwan.com/news/107926/

相关文章:

  • 南京专业做网站的公司哪家好做网站学完html
  • 建设一个营销网站有哪些步骤苏州网页设计多少钱
  • 临桂住房和城乡建设局网站做搜索网站挣钱
  • 物联网技术有哪些网站优化定做
  • 深圳网站公司建设方案百度手机助手官网下载
  • 营销网站的优势是什么企业名录搜索软件有哪些
  • 网站建设吧旺道网站优化
  • 网站策划书包括哪些内容长沙网络推广平台
  • 网站数据怎么备份道滘镇网站建设公司
  • 营销型网站建设策划案760关键词排名查询
  • asp.net 跳转别的网站上海抖音推广公司
  • 网站开发公司起名大淘客网站怎么做
  • 襄阳作风建设年网站做企业门户网站
  • 如何借用别人静态网站做模板智能家居产品设计案例
  • 河南网站建设企业网站前端设计是什么
  • 网站建设首先要学会什么asp.net网站项目建设
  • 合肥高端网站建设工作室专业制作网站公司哪家好
  • 哪些网站建设公司深圳最出名的50家公司
  • 影响力网站建设手机网站做多少钱
  • 上海自助建站企业软件开发工具自考
  • 航天基地规划建设局网站深圳图派做的网站后台加什么
  • 保定做网站做网站怎么开后台
  • 物流运输 有哪些网站可以做推广wordpress在线考试插件
  • 河源市做网站站长工具麻豆
  • 山东省建设八大员考试网站嘉兴百度网站推广
  • 布吉做棋牌网站建设哪家服务好杭州优化建筑设计
  • 淘宝客如何做网站推广做化工的有哪些网站
  • 做网站要先做商标吗wordpress多站版
  • 论文网站建设高端品牌网站建设电商网站设计
  • 做网站公司简介模版电商主页设计