当前位置:网站首页>Build and train your own dataset for pig face recognition
Build and train your own dataset for pig face recognition
2022-06-25 01:55:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
I took a detour in the actual process , Make special notes , For future reference .
The idea is to build VOC2007 Format pig face data Set , It's converting to tf Format , And then use it tf Of objectdetectionapi Training . The reason is that 2 Be familiar with all the construction methods , And go through all the processes .
1、 The architecture VOC2007 Pig face dataset in
Premise : Create a subdirectory with the following relationship under a directory .
—— Annotations
—— ImageSets
—— Main
—— JPEGImages
First step : Prepare the pictures you need , It is best to jpg Format . If not, it needs to be converted to jpg Format .
Because many pictures are found on the Internet , Format 、 It's not the same size , It is better to unify the size for the follow-up training , And convert the format into jpg Format .
Number of pictures , Generally speaking, it is better to have more than 1000 pieces . In order to achieve good results in the follow-up training , It's better to have more than 10000 .
The second step : Rename the picture , because VOC2007 Format must be JPG Format , And the picture is a unified six digit number , from 000001 Start . Then we also need to rename all training images to this .
After renaming, all pictures can be copied to JPEGImages Under the table of contents .
The third step : Mark the target object . Recommend to use labelImg, Because it can directly generate data that conforms to VOC2007 Format xml file .
It's mainly physical work .
All generated xml Files can be copied to Annotations Under the table of contents .
Step four : Data set segmentation .
In the actual training process , Four files are required , Respectively test.txt It's a test set ,train.txt It's a training set ,val.txt It's a validation set ,trainval.txt It's a training and validation set . Each file has a name for the picture . stay VOC2007 in ,trainval About the whole data set 50%,test It's probably the of the whole data set 50%;train Probably trainval Of 50%,val Probably trainval Of 50%.
reference python Source code :split-datasets.py
Generated four txt Files can be copied to Main Under the table of contents .
Step five : If there is no copy action in the above steps, copy the corresponding files to the corresponding directory in this step . To conform to VOC2007 Format requirements .
—— Annotations take xml Put all the files in this folder
—— ImageSets
—— Main It has four txt file ,test.txt It's a test set ,train.txt It's a training set ,val.txt It's a validation set ,trainval.txt It's a training and validation set .Txt The content in is the name of the picture ( no suffix ).
—— JPEGImages Put all training pictures in this folder
Step six : Copy the above directories and their files to pigfaces/VOC2007/ Next .
Step seven : convert to tf Of record Data set file in the format .
Run the following command :cd To xxx\object_detection Under the table of contents .python create_pascal_tf_record.py –data_dir=xxxx\object_detection\pigfaces –year=VOC2007 –set=train –output_path=data\pig_train.record
Step eight : Training .
Run the following command :cd To xxx\objectdetection\object_detection Under the table of contents .python train.py –train_dir=data –pipeline_config_path=models\faster_rcnn_resnet101_voc07.config
Aforementioned 6,7,8 Please refer to my github Code , The address is https://github.com/renwoxing2016/Objectdetectionapi/.
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/151884.html Link to the original text :https://javaforall.cn
边栏推荐
- 胰蛋白酶中英文说明书
- Unity C# 网络学习(六)——FTP(二)
- Application session coverage solutions with different ports on the same server
- Some Modest Advice for Graduate Students - by Stephen C. Stearns, Ph.D.
- 菊花链(寒假每日一题 39)
- Numerical scheme simulation of forward stochastic differential equations with Markov Switching
- ‘distutils‘ has no attribute ‘version
- Stocking but not completely stocking (daily question 2 in spring)
- 放养但没有完全放养(春季每日一题 2)
- 脱氧核糖核酸酶I中英文说明书
猜你喜欢
DataEase模板市场正式发布
PS5连接OPPO K9电视不支持2160P/4K
Multi modal data can also be Mae? Berkeley & Google proposed m3ae to conduct Mae on image and text data! The optimal masking rate can reach 75%, significantly higher than 15% of Bert
Intégration de la plate - forme de test continu open source de metersphere avec Alibaba Cloud Effect devops
Constant current circuit composed of 2 NPN triodes
1. package your own scaffold 2 Create code module
中文地址与英文地址
Abnova CSV magnetic beads description in Chinese and English
2个NPN三极管组成的恒流电路
Abnova 5-methylcytosine polyclonal antibody
随机推荐
The innovation consortium of Haihe laboratory established gbase and became one of the first member units of the innovation Consortium (Xinchuang)
通达信哪个开户更安全,更好点
屡获大奖的界面控件开发包DevExpress v22.1官宣发布
js数组对象转对象
Fake wireless speakers in stores? Sony responded: the product has reserved a wired connection interface, which can be used in complex scenarios
广发期货安全吗?开户需要什么东西?
Pbcms adding cyclic digital labels
国内炒股开户正规安全的具体名单
mpls 笔记 part 1
Chinese and English instructions of trypsin
Basic use of transformers Library
php中preg_replace如何替换变量数据
Google browser console F12 how to set the Chinese / English switching method, we must see the last!!!
Fatigue liée à l'examen du marché secondaire des médicaments innovants: succès clinique de la phase III et approbation du produit
linux上查看mysql的密码_Linux下MySQL忘记密码「建议收藏」
IPC mechanism
论文翻译 | RandLA-Net: Efficient Semantic Segmentation of Large-Scale Point Clouds
Abnova丨5-甲基胞嘧啶多克隆抗体中英文说明
谈谈飞书对开发工作的优势 | 社区征文
明日考试 最后一天如何备考?二造考点攻略全整理