当前位置:网站首页>Recognition of high-speed road signs by Matlab using alexnet
Recognition of high-speed road signs by Matlab using alexnet
2022-04-23 20:21:00 【Install a sound 77】
A classic case of transfer learning ,Alexnet It needs to be downloaded , Download requires registration matlab account number , Of course, this model is also available online , Make yourself at home .
doc Alexnet doc trainFasterRCNNObjectDetector
You can find the case information provided on the official website .
There are also relevant cases on the Internet for reference , Mainly refer to these two :
Of course, the actual use will certainly have bug, It needs to be adjusted slowly .
Just pay attention to the overall format , Just go . It takes up more memory when running .
clc
clear all
load('alexnet.mat',"net")
image = imageDatastore('C:\Users\1\Desktop\matlab_test_net',...
'IncludeSubfolders',true,'LabelSource','foldernames');
layersTransfer=net.Layers(1:end-3);
numClasses = numel(categories(image.Labels));
layers = [
layersTransfer
fullyConnectedLayer(numClasses,'WeightLearnRateFactor',20,'BiasLearnRateFactor',20)
softmaxLayer
classificationLayer];
options = trainingOptions('sgdm', ...
'MiniBatchSize',5, ...
'MaxEpochs',20, ...
'InitialLearnRate',0.0001);
netTransfer = trainNetwork(image,layers,options)
This is basically the default , Just change the photo storage path , Be careful img It's a photo format .
test= load('F:/xunlian/test.mat'); %it is not necessary
options = trainingOptions('sgdm', ...
'InitialLearnRate', 1e-5, ...
'MaxEpochs', 20, ... %twenty times The more training depth is not the better , It could backfire ,
'CheckpointPath', tempdir);
layer=netTransfer.Layers
% Here's the tsst incorrect , It should be a set of arrays , Is not a mat Count .
naq = readtable('test_table_youdian.xls')
% Use table Combine the data , Instead of importing from the outside
%naqq=table(test.gTruth.DataSource.Source,)
% For this naq To deal with
file = [] ;
aaa = test.gTruth.LabelData.biaozhi;
for i =1:30
file2=[file;test.gTruth.DataSource.Source{i}];
%table2array(test.gTruth.LabelData(2,1))
end
file=naq.imageFilename;
naqqq=table(file,aaa)
This data type is mainly made into table type ,
There are two ways One is from mat Put the data in the file and table() Combine
There's another one readtable() read excel Data in , Depending on your personal situation, choose .
The data in this is actually , Path and cut point
Training takes some time ( Add a key point , Need to add one backgroud Folder , Because this model is essentially a classification model , At least two categories are required, that is, there are two data sets , If you encounter this error , Refer to the previous blog )
And then I put this detector Save as mat Format
Then comes the test
img=imread(" picture .jpg")
load('wangluo.mat')
[bbox,score,label] = detect(detector,img);
index = find(score>0.8);
bbox = bbox(index,:);
score = score(index,:);
label = label(index,:);
img = insertObjectAnnotation(img,'Rectangle',bbox,score);
img = insertShape(img,'Rectangle',bbox);
imshow(img)
The test image is shown below :
It's rough , But the good thing is that it's simple , convenient , fast ......
Just make do with it , Don't think about publishing a paper .
版权声明
本文为[Install a sound 77]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210551491110.html
边栏推荐
- Paper writing 19: the difference between conference papers and journal papers
- 使用 WPAD/PAC 和 JScript在win11中进行远程代码执行1
- Commit and ROLLBACK in DCL of 16mysql
- 还在用 ListView?使用 AnimatedList 让列表元素动起来
- R language uses timeroc package to calculate the multi time AUC value of survival data under competitive risk, uses Cox model and adds covariates, and R language uses the plotauccurve function of time
- Redis installation (centos7 command line installation)
- Still using listview? Use animatedlist to make list elements move
- [latex] 5 how to quickly write out the latex formula corresponding to the formula
- SIGIR'22「微软」CTR估计:利用上下文信息促进特征表征学习
- R语言使用econocharts包创建微观经济或宏观经济图、indifference函数可视化无差异曲线、自定义计算交叉点、自定义配置indifference函数的参数丰富可视化效果
猜你喜欢
Mysql database backup scheme
RT-1052学习笔记 - GPIO架构分析
go-zero框架数据库方面避坑指南
【目标跟踪】基于帧差法结合卡尔曼滤波实现行人姿态识别附matlab代码
BMP JPEG 图片转换为矢量图像 ContourTrace
Commit and ROLLBACK in DCL of 16mysql
SQL Server Connectors By Thread Pool | DTSQLServerTP plugin instructions
Sqoop imports tinyint type fields to boolean type
Numpy mathematical function & logical function
selenium.common.exceptions.WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT
随机推荐
Browser - learning notes
SQL Server Connectors By Thread Pool | DTSQLServerTP plugin instructions
Paper writing 19: the difference between conference papers and journal papers
Sqoop imports tinyint type fields to boolean type
Error reported by Azkaban: Azkaban jobExecutor. utils. process. ProcessFailureException: Process exited with code 127
Historical track data reading of Holux m1200-e Bluetooth GPS track recorder
Handwritten Google's first generation distributed computing framework MapReduce
The market share of the financial industry exceeds 50%, and zdns has built a solid foundation for the financial technology network
NC basic usage
Leetcode dynamic planning training camp (1-5 days)
Tensorflow 2 basic operation dictionary
Mysql database and table building: the difference between utf8 and utf8mb4
Redis的安装(CentOS7命令行安装)
Unity 模型整体更改材质
Customize timeline component styles
How to do product innovation—— Exploration of product innovation methodology I
【问题解决】‘ascii‘ codec can‘t encode characters in position xx-xx: ordinal not in range(128)
NC basic usage 4
Change the material of unity model as a whole
Research on open source OCR engine