当前位置:网站首页>Implement your own dataset using bisenet
Implement your own dataset using bisenet
2022-07-07 08:23:00 【I am a little rice】
Data set preparation
Data sets : Remote sensing house image segmentation , There are two times , It is mainly to realize the area change of building area with time .
Baidu cloud :https://pan.baidu.com/s/1HlnKWToc00986jiTxhq_CA
Extraction code :RSAI
Data processing
1. Data sets
The data set is stored in the root directory datasets Under the folder , And coco and city Data set juxtaposition , If the label of your dataset is already 0,1, Then don't worry label_255, If the label has not passed 255-->1 The transformation of , You can put the label file in label_255 Next .
—BiSeNet
---------datasets
-----------------coco
-----------------cityscapes
-----------------time
-----------------------train
------------------------------image
------------------------------label_255
------------------------------label
-----------------------val
------------------------------image
------------------------------label_255
------------------------------label
2. stay datasets/times/ Create under folder one.py
The aim is to 0,255 The label of is converted to 0,1, If it's multi class , Then the label is 0,1,2,3,...n
In the code, only train Documents in , To transform val Documents in , modify train by val that will do
import os
import cv2 as cv
labels_path = './train/label_255'
labels_save_path = './train/label'
lab_names = os.listdir(labels_path)
for s in lab_names:
label_path = os.path.join(labels_path, s)
label_save_path = os.path.join(labels_save_path, s)
label = cv.imread(label_path, 0)
label[label!=0]=1
cv.imwrite(label_save_path, label)
2. stay datasets/times/ Create under folder util.py file
The goal is to generate train.txt Document and val.txt file , To transform val.txt file , Just add all of the following code train Switch to val that will do ( There are three )
import os
image_path = './train/image'
label_path = './train/label'
image_names = os.listdir(image_path)
for s in image_names:
image = os.path.join(image_path, s)
label = os.path.join(label_path, s)
with open('train.txt', 'a') as fin:
fin.write(image[2:] +","+ label[2:] +"\n")
fin.close()
Network model address
Model modification
1. modify configs/bisenet_customer.py file

n_cats: Number of categories including background , The category here is 2max_iter: Training times im_root: Data path train_im_anns: Just generated train.txt route val_im_anns: Just generated val.txt route cropsize: Change to image size eval_crop: Change to image size ( I don't know the effect )ims_per_gpu:gpu Number
2. Modify category
This dataset category is 2
If configs/bisenet_customer.py Medium model_type='bisenetv2' modify lib/models/bisenetv2.py In the document n_classes=2

If configs/bisenet_customer.py Medium model_type='bisenetv1' modify lib/models/bisenetv1.py In the document BiSeNetV1(2)
Run the command
--nproc_per_node Do not know what that mean? , there 2 yes gpu The number of
CUDA_VISIBLE_DEVICES=0,1 torchrun --nproc_per_node=2 tools/train_amp.py --config configs/bisenet_customer.py
And it's going to work !!
边栏推荐
- 轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
- Quick analysis of Intranet penetration helps the foreign trade management industry cope with a variety of challenges
- Using helm to install rainbow in various kubernetes
- Battery and motor technology have received great attention, but electric control technology is rarely mentioned?
- Rainbond 5.6 版本发布,增加多种安装方式,优化拓扑图操作体验
- Leetcode medium question my schedule I
- Automatic upgrading of database structure in rainbow
- The truth of robot education in hands-on practice
- Openjudge noi 2.1 1752: chicken and rabbit in the same cage
- CCTV is so warm-hearted that it teaches you to write HR's favorite resume hand in hand
猜你喜欢

Analyzing the influence of robot science and technology development concept on Social Research

Don't stop chasing the wind and the moon. Spring mountain is at the end of Pingwu

云原生存储解决方案Rook-Ceph与Rainbond结合的实践

Notes on PHP penetration test topics

OpenVSCode云端IDE加入Rainbond一体化开发体系

电池、电机技术受到很大关注,反而电控技术却很少被提及?

Splunk子查询模糊匹配csv中字段值为*

Qinglong panel - today's headlines

Use of JMeter

Myabtis_ Plus
随机推荐
Fast parsing intranet penetration escorts the document encryption industry
The largest 3 same digits in the string of leetcode simple question
Quick analysis of Intranet penetration helps the foreign trade management industry cope with a variety of challenges
Analysis of maker education in innovative education system
Leetcode medium question my schedule I
XCiT学习笔记
Rsync remote synchronization
[IELTS speaking] Anna's oral learning records part2
Tuowei information uses the cloud native landing practice of rainbow
【无标题】
offer收割机:两个长字符串数字相加求和(经典面试算法题)
opencv学习笔记三——图像平滑/去噪处理
JS复制图片到剪切板 读取剪切板
CCTV is so warm-hearted that it teaches you to write HR's favorite resume hand in hand
一文了解如何源码编译Rainbond基础组件
GFS分布式文件系统
漏洞複現-Fastjson 反序列化
MES系统,是企业生产的必要选择
eBPF Cilium实战(2) - 底层网络可观测性
[quick start of Digital IC Verification] 14. Basic syntax of SystemVerilog learning 1 (array, queue, structure, enumeration, string... Including practical exercises)