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

flash网站在线diy源码首页网站怎么做

flash网站在线diy源码,首页网站怎么做,品牌logo设计在线生成,网站到底是域名需要备案还是空间更多图像分类、图像识别、目标检测等项目可从主页查看 功能演示#xff1a; 皮肤病识别系统 vgg16 resnet50 卷积神经网络 GUI界面 前端界面#xff08;pytorch框架 python源码#xff09;_哔哩哔哩_bilibili #xff08;一#xff09;简介 基于卷积神经网络的皮肤病识… 更多图像分类、图像识别、目标检测等项目可从主页查看 功能演示 皮肤病识别系统 vgg16 resnet50 卷积神经网络 GUI界面 前端界面pytorch框架 python源码_哔哩哔哩_bilibili 一简介 基于卷积神经网络的皮肤病识别系统是在pytorch框架下实现的系统中有两个模型可选resnet50模型和VGG16模型这两个模型可用于模型效果对比增加工作量。 该系统涉及的技术栈有GUI界面python pyqt5前端界面python flask   该项目是在pycharm和anaconda搭建的虚拟环境执行pycharm和anaconda安装和配置可观看教程 超详细的pycharmanaconda搭建python虚拟环境_pycharm配置anaconda虚拟环境-CSDN博客 pycharmanaconda搭建python虚拟环境_哔哩哔哩_bilibili 二项目介绍 1. 项目结构 2. 数据集  部分数据展示  3.GUI界面技术栈pyqt5python  4.前端界面技术栈pythonflask 5. 核心代码  class MainProcess:def __init__(self, train_path, test_path, model_name):self.train_path train_pathself.test_path test_pathself.model_name model_nameself.device torch.device(cuda:0 if torch.cuda.is_available() else cpu)def main(self, epochs):# 记录训练过程log_file_name ./results/vgg16训练和验证过程.txt# 记录正常的 print 信息sys.stdout Logger(log_file_name)print(using {} device..format(self.device))# 开始训练记录开始时间begin_time time()# 加载数据train_loader, validate_loader, class_names, train_num, val_num self.data_load()print(class_names: , class_names)train_steps len(train_loader)val_steps len(validate_loader)# 加载模型model self.model_load() # 创建模型# 网络结构可视化x torch.randn(16, 3, 224, 224) # 随机生成一个输入model_visual_path results/vgg16_visual.onnx # 模型结构保存路径torch.onnx.export(model, x, model_visual_path) # 将 pytorch 模型以 onnx 格式导出并保存# netron.start(model_visual_path) # 浏览器会自动打开网络结构# load pretrain weights# download url: https://download.pytorch.org/models/vgg16-397923af.pthmodel_weight_path models/vgg16-pre.pthassert os.path.exists(model_weight_path), file {} does not exist..format(model_weight_path)model.load_state_dict(torch.load(model_weight_path, map_locationcpu))# 更改Vgg16模型的最后一层model.classifier[-1] nn.Linear(4096, len(class_names), biasTrue)# 将模型放入GPU中model.to(self.device)# 定义损失函数loss_function nn.CrossEntropyLoss()# 定义优化器params [p for p in model.parameters() if p.requires_grad]optimizer optim.Adam(paramsparams, lr0.0001)train_loss_history, train_acc_history [], []test_loss_history, test_acc_history [], []best_acc 0.0for epoch in range(0, epochs):# 下面是模型训练model.train()running_loss 0.0train_acc 0.0train_bar tqdm(train_loader, filesys.stdout)# 进来一个batch的数据计算一次梯度更新一次网络for step, data in enumerate(train_bar):images, labels data # 获取图像及对应的真实标签optimizer.zero_grad() # 清空过往梯度outputs model(images.to(self.device)) # 得到预测的标签train_loss loss_function(outputs, labels.to(self.device)) # 计算损失train_loss.backward() # 反向传播计算当前梯度optimizer.step() # 根据梯度更新网络参数# print statisticsrunning_loss train_loss.item()predict_y torch.max(outputs, dim1)[1] # 每行最大值的索引# torch.eq()进行逐元素的比较若相同位置的两个元素相同则返回True若不同返回Falsetrain_acc torch.eq(predict_y, labels.to(self.device)).sum().item()train_bar.desc train epoch[{}/{}] loss:{:.3f}.format(epoch 1,epochs,train_loss)# 下面是模型验证model.eval() # 不启用 BatchNormalization 和 Dropout保证BN和dropout不发生变化val_acc 0.0 # accumulate accurate number / epochtesting_loss 0.0with torch.no_grad(): # 张量的计算过程中无需计算梯度val_bar tqdm(validate_loader, filesys.stdout)for val_data in val_bar:val_images, val_labels val_dataoutputs model(val_images.to(self.device))val_loss loss_function(outputs, val_labels.to(self.device)) # 计算损失testing_loss val_loss.item()predict_y torch.max(outputs, dim1)[1] # 每行最大值的索引# torch.eq()进行逐元素的比较若相同位置的两个元素相同则返回True若不同返回Falseval_acc torch.eq(predict_y, val_labels.to(self.device)).sum().item()train_loss running_loss / train_stepstrain_accurate train_acc / train_numtest_loss testing_loss / val_stepsval_accurate val_acc / val_numtrain_loss_history.append(train_loss)train_acc_history.append(train_accurate)test_loss_history.append(test_loss)test_acc_history.append(val_accurate)print([epoch %d] train_loss: %.3f val_accuracy: %.3f %(epoch 1, train_loss, val_accurate))if val_accurate best_acc:best_acc val_accuratetorch.save(model.state_dict(), self.model_name)# 记录结束时间end_time time()run_time end_time - begin_timeprint(该循环程序运行时间, run_time, s)# 绘制模型训练过程图self.show_loss_acc(train_loss_history, train_acc_history,test_loss_history, test_acc_history)# 画热力图self.heatmaps(model, validate_loader, class_names) 该系统可以训练自己的数据集训练过程也比较简单只需指定自己数据集中训练集和测试集的路径训练后模型名称和指定训练的轮数即可  训练结束后可输出以下结果 a. 训练过程的损失曲线 b. 模型训练过程记录模型每一轮训练的损失和精度数值记录 c. 模型结构 模型评估可输出 a. 混淆矩阵 b. 测试过程和精度数值 c. 准确率、精确率、召回率、F1值  三总结 以上即为整个项目的介绍整个项目主要包括以下内容完整的程序代码文件、训练好的模型、数据集、UI界面和各种模型指标图表等。 整个项目包含全部资料一步到位省心省力 项目运行过程如出现问题请及时交流
http://www.hkea.cn/news/14406698/

相关文章:

  • 如何做请求队列防止网站高并发大沥网站设计
  • 响应式网站用什么工具网页免费下载
  • 个人网站备案能做什么内容北京装饰公司排行 2019
  • 做网站需要怎么分工常德网站建设哪家权威
  • 健身网站模板旅游网站怎样做宣传
  • 网站空间邮箱网络架构和现实架构的差异
  • html5特效网站wordpress导出pdf
  • 软件技术是什么优化网站做内链接
  • 个人网站介绍六灶网站建设
  • 做资源教程网站五星级酒店网站建设方案
  • 新网站如何做百度收录外贸网站平台seo推广
  • 网站seo链接购买爱站工具包的主要功能
  • 国外网站怎么建设seo应该如何做
  • 网站内容维护合同建筑外观设计网站
  • 网上做效果图网站有哪些软件有哪些广告设计与制作专业需要美术功底吗
  • 口碑好的免费网站建设专业做礼品团购的网站
  • 做网站分几步wordpress demo data
  • 电商网站前台模块网站开发的书
  • 即墨有做网站的吗湖南网站建设有限公司
  • 南京微信网站开发wordpress功能 更改
  • 网级移动营销免费下载优化大师
  • 做鞋子皮革有什么网站wordpress调用文章的tags
  • 焦作网站建设哪家专业自贡企业网站建设公司
  • 高端网站设计推广v信haotg8旅游网站界面设计
  • 永嘉县住房和城乡规划建设局网站公司网页制作培训试题
  • 网站维护运行建设报告宁波做外贸网站建设
  • 想做苗木生意网站怎么怎么做一家专门做打折的网站
  • 新浪博客怎么给自己网站做链接吗国家高新技术企业证书图片
  • 比较好的网站开发项目如何做个网站做cpa
  • 建立网站 用英语网站标题算关键词优化吗