语义分割网络Segnet在Cityscapes数据集上的探索

搭建目标检测模型之Domain Adaptive Faster R-CNN for Object Detection in the Wild 搭建目标检测模型Domain-Adaptive-Faster-RCNN-PyTorch,涉及环境搭建、训练和测试的流程,对过程中出现的问题给出了解决办法。 阅读详情

Part 1 数据准备

  1. 从Cityscapes官网下载Groundtruth: leftImg8bit_trainvaltest.zip与Label:gtFine_trainvaltest.zip(图1)

图1 从官网下载数据集

leftImg8bit:放置训练街景图,按城市分子文件夹,存放png图片(命名格式:城市名称_6位数字_6位数字_leftImg8bit.png)(图2)

图2 leftImg8bit中的街景原图

gtFine:放置精细标注文件,分train(18个城市)/val(3个城市)/test(6个城市)三个文件夹,每个城市文件夹下针对每张街景图png文件对应了4个标注文件(图3):

- xxx_gtFine_color.png 代表可视化的分割图

- xxx_gtFine_instanceIds.png 代表实例分割标注文件

- xxx_gtFine_labelIds.png 代表每个实例的标签id标注

- xxx_gtFine_polygons.json

图3 gtFine中的标注文件

2.导入所需的库和模块

import os
import cv2
import glob
import torch
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from tqdm import tqdm,trange
import torchvision.transforms as transforms
import torchvision.datasets as datasets
import torch.nn as nn
import torch.nn.functional as F
from torch import optim
# Make numpy printouts easier to read.
np.set_printoptions(precision=3, suppress=True)

3.加载训练和验证数据集,测试数据集没有标注,所以我们将把训练数据分割成训练和测试数据

train_label_data_path = '/home/luyx/zk/Cityscapes/gtFine/train'
valid_label_data_path = '/home/luyx/zk/Cityscapes/gtFine/val'
train_img_path = '/home/luyx/zk/Cityscapes/leftImg8bit/train'
valid_img_path = '/home/luyx/zk/Cityscapes/leftImg8bit/val
train_labels = sorted(glob.glob(train_label_data_path+"/*/*_labelIds.png"))
valid_labels = sorted(glob.glob(valid_label_data_path+"/*/*_labelIds.png"))
train_inp = sorted(glob.glob(train_img_path+"/*/*.png"))
valid_inp = sorted(glob.glob(valid_img_path+"/*/*.png"))
#每张图片的大小:cv2.imread(train_labels[0]).shape:(1024,2048,3)
from collections import namedtuple
labels = [
    #       name                     id    trainId   category            catId     hasInstances   ignoreInEval   color
    Label(  'unlabeled'            ,  0 ,      255 , 'void'            , 0       , False        , True         , (  0,  0,  0) ),
    Label(  'ego vehicle'          ,  1 ,      255 , 'void'            , 0       , False        , True         , (  0,  0,  0) ),
    Label(  'rectification border' ,  2 ,      255 , 'void'            , 0       , False        , True         , (  0,  0,  0) ),
    Label(  'out of roi'           ,  3 ,      255 , 'void'            , 0       , False        , True         , (  0,  0,  0) ),
    Label(  'static'               ,  4 ,      255 , 'void'            , 0       , False        , True         , (  0,  0,  0) ),
    Label(  'dynamic'              ,  5 ,      255 , 'void'            , 0       , False        , True         , (111, 74,  0) ),
    Label(  'ground'               ,  6 ,      255 , 'void'            , 0       , False        , True         , ( 81,  0, 81) ),
    Label(  'road'                 ,  7 ,        0 , 'flat'            , 1       , False        , False        , (128, 64,128) ),
    Label(  'sidewalk'             ,  8 ,        1 , 'flat'            , 1       , False        , False        , (244, 35,232) ),
    Label(  'parking'              ,  9 ,      255 , 'flat'            , 1       , False        , True         , (250,170,160) ),
    Label(  'rail track'           , 10 ,      255 , 'flat'            , 1       , False        , True         , (230,150,140) ),
    Label(  'building'             , 11 ,        2 , 'construction'    , 2       , False        , False        , ( 70, 70, 70) ),
    Label(  'wall'                 , 12 ,        3 , 'construction'    , 2       , False        , False        , (102,102,156) ),
    Label(  'fence'                , 13 ,        4 , 'construction'    , 2       , False        , False        , (190,153,153) ),
    Label(  'guard rail'           , 14 ,      255 , 'construction'    , 2       , False        , True         , (180,165,180) ),
    Label(  'bridge'               , 15 ,      255 , 'construction'    , 2       , False        , True         , (150,100,100) ),
    Label(  'tunnel'               , 16 ,      255 , 'construction'    , 2       , False        , True         , (150,120, 90) ),
    Label(  'pole'                 , 17 ,        5 , 'object'          , 3       , False        , False        , (153,153,153) ),
    Label(  'polegroup'            , 18 ,      255 , 'object'          , 3       , False        , True         , (153,153,153) ),
    Label(  'traffic light'        , 19 ,        6 , 'object'          , 3       , False        , False        , (250,170, 30) ),
    Label(  'traffic sign'         , 20 ,        7 , 'object'          , 3       , False        , False        , (220,220,  0) ),
    Label(  'vegetation'           , 21 ,        8 , 'nature'          , 4       , False        , False        , (107,142, 35) ),
    Label(  'terrain'              , 22 ,        9 , 'nature'          , 4       , False        , False        , (152,251,152) ),
    Label(  'sky'                  , 23 ,       10 , 'sky'             , 5       , False        , False        , ( 70,130,180) ),
    Label(  'person'               , 24 ,       11 , 'human'           , 6       , True         , False        , (220, 20, 60) ),
    Label(  'rider'                , 25 ,       12 , 'human'           , 6       , True         , False        , (255,  0,  0) ),
    Label(  'car'                  , 26 ,       13 , 'vehicle'         , 7       , True         , False        , (  0,  0,142) ),
    Label(  'truck'                , 27 ,       14 , 'vehicle'         , 7       , True         , False        , (  0,  0, 70) ),
    Label(  'bus'                  , 28 ,       15 , 'vehicle'         , 7       , True         , False        , (  0, 60,100) ),
    Label(  'caravan'              , 29 ,      255 , 'vehicle'         , 7       , True         , True         , (  0,  0, 90) ),
    Label(  'trailer'              , 30 ,      255 , 'vehicle'         , 7       , True         , True         , (  0,  0,110) ),
    Label(  'train'                , 31 ,       16 , 'vehicle'         , 7       , True         , False        , (  0, 80,100) ),
    Label(  'motorcycle'           , 32 ,       17 , 'vehicle'         , 7       , True         , False        , (  0,  0,230) ),
    Label(  'bicycle'              , 33 ,       18 , 'vehicle'         , 7       , True         , False        , (119, 11, 32) ),
    Label(  'license plate'        , -1 ,       -1 , 'vehicle'         , 7       , False        , True         , (  0,  0,142) ),
]

4.将_gtFine_labelIds灰度图图像转换为彩色分割图(图4)

#需要显示为彩色的标签(即labels_used,ignoreinEval == False)的那一列将被筛选出来形成新的列表,
#其trainID将被重新编码为0,1,2……,其余未被筛选出来的trainId的为255,显示为黑色
labels_used = []
ids = []
for i in range(len(labels)):
  if(labels[i].ignoreInEval == False):
    labels_used.append(labels[i])
    ids.append(labels[i].id)

#以其中一张标签图为例:
label_in = cv2.imread(train_labels[0])[:,:,0]

#create a dictionary with label_id as key & train_id as value
label_dic = {}
for i in range(len(labels)-1):
  label_dic[labels[i].id] = labels[i].trainId

#将labelids转换为trainids
def createtrainID(label_in,label_dic):
  mask = np.zeros((label_in.shape[0],label_in.shape[1]))   # 1024,2048
  l_un = np.unique(label_in)   #找出label_in中所有的id
  for i in range(len(l_un)):
    mask[label_in==l_un[i]] = label_dic[l_un[i]]  #将id转换为trainid
  return mask

#展示灰度图转换后的彩色图
def visual_label(mask,labels_used,plot = False):
  label_img = np.zeros((mask.shape[0],mask.shape[1],3))
  r = np.zeros((mask.shape[0],mask.shape[1]))
  g = np.zeros((mask.shape[0],mask.shape[1]))
  b = np.zeros((mask.shape[0],mask.shape[1]))
  l_un = np.unique(mask)
  for i in range(len(l_un)):
    if l_un[i]<19:
      r[mask==int(l_un[i])] = labels_used[int(l_un[i])].color[0]
      g[mask==int(l_un[i])] = labels_used[int(l_un[i])].color[1]
      b[mask==int(l_un[i])] = labels_used[int(l_un[i])].color[2]
  label_img[:,:,0] = r/255
  label_img[:,:,1] = g/255
  label_img[:,:,2] = b/255
  if plot:
    plt.imshow(label_img)
  return label_img

 label_img = visual_label(createtrainID(label_in,label_dic),labels_used,plot = True)

图4 将灰度图转换为彩色分割图

5.展示不同色块代表的物体(图5)

fig = plt.figure(figsize = (10,10))

for i in range(len(labels_used)):
    temp = np.zeros((5,5,3))
    temp[:,:,0] = labels_used[i].color[0]/255
    temp[:,:,1] = labels_used[i].color[1]/255
    temp[:,:,2] = labels_used[i].color[2]/255
    ax = fig.add_subplot(5, 4, i+1)
    ax.imshow(temp)
    ax.set_title(labels_used[i].name)
    ax.axis('off')

图5 展示不同色块代表的物体

6.数据预处理

#1.resize为(96,96)  2.将数据转换为(通道数,宽,高)
def gen_images(x,s1=96,s2=96):
    _,_,s3 = cv2.imread(x).shape
    img = np.zeros((s1,s2,s3))
    image= cv2.resize(cv2.imread(x),(s1,s2),interpolation = cv2.INTER_NEAREST)
    image = image/255
    img[:,:,:] = image
    return torch.tensor(img).permute(2,0,1)

def gen_mask_train(x,label_dic,s1=96,s2=96):
  #s1,s2,_ = cv2.imread(x[0]).shape
  mask = np.zeros((s1,s2))
  image = createtrainID(cv2.resize(cv2.imread(x),(s1,s2),interpolation = cv2.INTER_NEAREST)[:,:,0],label_dic)
  mask[:,:] = image
  mask[mask==255] = 19
  return torch.tensor(mask)

7.对街景图使用gen_images处理,对标签图使用gen_mask_train处理,然后抽取80%的数据作为训练集

train_images=[]
train_label=[]
valid_images=[]
valid_label=[]
for i in trange(len(train_inp)):
    train_images.append(gen_images(train_inp[i]))
    train_label.append(gen_mask_train(train_labels[i],label_dic))
for i in trange(len(valid_inp)):
    valid_images.append(gen_images(valid_inp[i]))
    valid_label.append(gen_mask_train(valid_labels[i],label_dic)) 

train = []
for x in zip(train_images,train_label):
  train.append(x)
valid_dataset =[]
for x in zip(valid_images,valid_label):
  valid_dataset.append(x)

n =  len(train)
train_n = int(0.8*n) 
np.random.seed(0)
perm = np.random.permutation(n)
train_dataset = []
test_dataset = []
for i in range(len(perm[0:train_n])):   
  train_dataset.append(train[perm[i]])
for i in range(len(perm[train_n:n])):
  test_dataset.append(train[perm[i]])

8.数据加载

train_loader = torch.utils.data.DataLoader(train_dataset, 
                                           batch_size=64, 
                                           shuffle=True, 
                                           num_workers=0)
valid_loader = torch.utils.data.DataLoader(valid_dataset, 
                                           batch_size=64, 
                                           shuffle=True, 
                                           num_workers=0)
test_loader = torch.utils.data.DataLoader(test_dataset, 
                                           batch_size=64, 
                                           shuffle=True, 
                                           num_workers=0)

Part 2 SegNet模型构建

构建4个基础模块

#模块1:convulution->batch_norm->relu
class single_conv(nn.Module):
    def __init__(self, in_ch, out_ch):
        super(single_conv, self).__init__()    # Note: for conv, use a padding of (1,1) so that size is maintained
        self.conv = nn.Conv2d(in_ch, out_ch, kernel_size=3,padding = 1)
        self.bn = nn.BatchNorm2d(out_ch,momentum = 0.1)
        self.relu = nn.ReLU()
    def forward(self, x):
        x = self.conv(x)
        x = self.bn(x)
        x = self.relu(x)
        return x
#模块2:maxpool
class down_layer(nn.Module):
    def __init__(self):
        super(down_layer, self).__init__()
        self.down = nn.MaxPool2d(kernel_size=2, stride=2, return_indices=True) # use nn.MaxPool2d( )        
    def forward(self, x):
        x1,idx = self.down(x)
        return x1,idx
#模块3:unpool(双线性插值上采样,亦可以用转置卷积)
class un_pool(nn.Module):
    def __init__(self):
        super(un_pool, self).__init__()       
        self.un_pool = nn.MaxUnpool2d(kernel_size=2, stride=2) # use nn.Upsample() with mode bilinear
    def forward(self, x, idx,x1):
        #Take the indicies from maxpool layer
        x = self.un_pool(x,idx,output_size = x1.size())
        return x 
#模块4:a convolution layer
class outconv(nn.Module):
    def __init__(self, in_ch, out_ch):
        super(outconv, self).__init__()
        # 1 conv layer
        self.conv = nn.Conv2d(in_ch, out_ch, kernel_size=3,padding = 1)
    def forward(self, x):
        # Forward conv layer
        x = self.conv(x)
        return x
class SegNet(nn.Module):
    def __init__(self, n_channels_in, n_classes):
        super(SegNet, self).__init__()
        self.conv1 = single_conv(n_channels_in,64)
        self.conv2 = single_conv(64,64)
        self.down1 = down_layer()
        self.conv3 = single_conv(64,128)
        self.conv4 = single_conv(128,128)
        self.down2 = down_layer()
        self.conv5 = single_conv(128,256)
        self.conv6 = single_conv(256,256)
        self.conv7 = single_conv(256,256)
        self.down3 = down_layer()
        self.conv8 = single_conv(256,512)
        self.conv9 = single_conv(512,512)
        self.conv10 = single_conv(512,512)
        self.down4 = down_layer()
        self.conv11 = single_conv(512,512)
        self.conv12 = single_conv(512,512)
        self.conv13 = single_conv(512,512)
        self.down5 = down_layer()
        self.up1 = un_pool()
        self.conv14 = single_conv(512,512)
        self.conv15 = single_conv(512,512)
        self.conv16 = single_conv(512,512)
        self.up2 = un_pool()
        self.conv17 = single_conv(512,512)
        self.conv18 = single_conv(512,512)
        self.conv19 = single_conv(512,256)
        self.up3 = un_pool()
        self.conv20 = single_conv(256,256)
        self.conv21 = single_conv(256,256)
        self.conv22 = single_conv(256,128)
        self.up4 = un_pool()
        self.conv23 = single_conv(128,128)
        self.conv24 = single_conv(128,64)
        self.up5 = un_pool()
        self.conv25 = single_conv(64,64)
        self.outconv1 = outconv(64,n_classes)
    def forward(self, x):
        x1 = self.conv1(x)
        x2 = self.conv2(x1)
        x3,idx1 = self.down1(x2)
        x4 = self.conv3(x3)
        x5 = self.conv4(x4)
        x6,idx2 = self.down2(x5)
        x7 = self.conv5(x6)
        x8 = self.conv6(x7)
        x9 = self.conv7(x8)
        x10,idx3 = self.down3(x9)
        x11 = self.conv8(x10)
        x12 = self.conv9(x11)
        x13 = self.conv10(x12)
        x14,idx4 = self.down4(x13)
        x15 = self.conv11(x14)
        x16 = self.conv12(x15)
        x17 = self.conv13(x16)
        x18,idx5 = self.down5(x17)
        x19 = self.up1(x18,idx5,x17)
        x20 = self.conv14(x19)
        x21 = self.conv15(x20)
        x22 = self.conv16(x21)
        x23 = self.up2(x22,idx4,x13)
        x24 = self.conv17(x23)
        x25 = self.conv18(x24)
        x26 = self.conv19(x25)
        x27 = self.up3(x26,idx3,x9)
        x28 = self.conv20(x27)
        x29 = self.conv21(x28)
        x30 = self.conv22(x29)
        x31 = self.up4(x30,idx2,x5)
        x32 = self.conv23(x31)
        x33 = self.conv24(x32)
        x34 = self.up4(x33,idx1,x2)
        x35 = self.conv25(x34)
        x = self.outconv1(x35)
        return x

Part 3 参数预设

net= SegNet(3,20)
optimizer = torch.optim.Adam(
    net.parameters(),
    lr=0.001,)
def initialize_parameters(m):
    if isinstance(m, nn.Conv2d):
        nn.init.kaiming_normal_(m.weight.data, nonlinearity = 'relu')
        nn.init.constant_(m.bias.data, 0)
net.apply(initialize_parameters)
weights = np.zeros((20))
for (_, y) in tqdm(train_loader):
    # y = gen_mask_train(y,label_dic)
    y = y.to(device).long()
    for i in range(20):
      weights[i] += torch.sum((y==i).type(torch.uint8))
weights = np.max(weights)/(weights)
# weights = weights*len(train_dataset)
weights = torch.FloatTensor(weights)
net = net.to(device)
criterion = nn.CrossEntropyLoss()
criterion = criterion.to(device)

Part 4 使用数据集进行训练

def mean_iou(y_pred,y,num_classes = 20,last_background = True,smooth = 0.001):
  y_pred = torch.argmax(y_pred,dim=1)
  mean_IoU = []
  if last_background:
    num_classes = num_classes - 1
  for i in range(num_classes):
    class_pred = (y_pred==i).type(torch.uint8)
    class_truth = (y==i).type(torch.uint8)
    union = torch.logical_or(class_pred,class_truth).type(torch.uint8)
    intersection = torch.logical_and(class_pred,class_truth).type(torch.uint8)
    IoU = torch.sum(intersection+0.001,dim=(1,2))/torch.sum(union+0.001,dim=(1,2))
    # intersection = torch.sum(intersection, dim =(1,2))
    # union = torch.sum(union, dim =(1,2))
    # if torch.sum((union!=0).type(torch.uint8))!=0:
    #   IoU = intersection[union!=0]/union[union!=0]
    mean_IoU.append(IoU.mean())
  mean_IoU = sum(mean_IoU)/num_classes
  return mean_IoU

1.定义训练与评估函数

def train(model, iterator, optimizer, criterion, device,label_dic):
    epoch_loss = 0
    epoch_IoU = 0
    model.train()
    for (x, y) in tqdm(iterator):
        x = x.to(device).type(torch.float)
        y = y.to(device).long()
        optimizer.zero_grad()      
        y_pred = model(x)
        loss = criterion(y_pred, y)
        IoU = mean_iou(y_pred, y)
        loss.backward()
        optimizer.step()
        epoch_loss += loss.item()
        epoch_IoU += IoU.item()
    return epoch_loss / len(iterator), epoch_IoU/len(iterator)

def evaluation(model, iterator, criterion, device,label_dic):
    epoch_loss = 0
    epoch_IoU = 0
    model.eval()
    with torch.no_grad():
      for (x, y) in tqdm(iterator):
          x = x.to(device).type(torch.float)
          y = y.to(device).long()
          y_pred = model(x)
          loss = criterion(y_pred, y)
          IoU = mean_iou(y_pred, y)
          epoch_loss += loss.item()
          epoch_IoU += IoU.item()
    return epoch_loss / len(iterator), epoch_IoU/len(iterator)
import time
def epoch_time(start_time, end_time):
    elapsed_time = end_time - start_time
    elapsed_mins = int(elapsed_time / 60)
    elapsed_secs = int(elapsed_time - (elapsed_mins * 60))
    return elapsed_mins, elapsed_sec

best_valid_loss = float('inf')

for epoch in range(100):
    start_time = time.time()
    train_loss,train_iou = train(net, train_loader, optimizer, criterion, device,label_dic)
    valid_loss,valid_iou = evaluation(net, valid_loader, criterion, device,label_dic)
    end_time = time.time()
    epoch_mins, epoch_secs = epoch_time(start_time, end_time)# ...
    if valid_loss < best_valid_loss:
        best_valid_loss = valid_loss
        torch.save(net.state_dict(), 'net.pt')
    print(f'Epoch: {epoch+1:02} | Epoch Time: {epoch_mins}m {epoch_secs}s')
    print(f'\tTrain Loss: {train_loss:.3f} | Train IoU: {train_iou}')
    print(f'\t Val. Loss: {valid_loss:.3f} | Valid IoU: {valid_iou}')

该网络结构在训练集上的结果较好,IoU可达0.82;但在测试集效果较差,IoU为0.61左右

2.展示预测结果(图6)

net.load_state_dict(torch.load('net.pt'))
test_loss,test_iou = evaluation(net, test_loader, criterion, device,label_dic)
print(f'\tTest Loss: {test_loss:.3f} | Test IoU: {test_iou}')
x,y = iter(test_loader).next()
img = x.to(device).type(torch.float)
mask = y.to(device)

net.eval()
with torch.no_grad():
  y_pred = net(img)
  
fig = plt.figure(figsize = (10,10))

for i in range(11,15):
  ax = fig.add_subplot(2, 4, i-10)
  visualization = visual_label(mask[i,:,:].cpu().numpy(),labels_used)
  ax.imshow(visualization)
  ax.set_title('Ground Truth')
  ax.axis('off')

  ax = fig.add_subplot(2, 4, i-6)
  y_test = y_pred.permute(0,2,3,1)[i,:,:,:].cpu().numpy()
  visual_test = visual_label(np.argmax(y_test,axis=2),labels_used)
  ax.imshow(visual_test)
  ax.set_title('Predicted')
  ax.axis('off')

图6 展示预测结果

2015年,Segnet模型由Vijay Badrinarayanan, Alex Kendall, Roberto Cipolla发表, 在FCN的语义分割任务基础上,搭建编码器-解码器对称结构,实现端到端的像素级别图像分割,其模型框架和思路都比较简单,后续我们将逐渐增加难度,探索更新的网络架构。

Segnet原文链接:https://arxiv.org/abs/1511.00561

·END·

图像语义分割模型DeepLab训练Cityscapes数据集过程记录 参考:https://github.com/tensorflow/models/blob/master/research/deeplab/g3doc/cityscapes.md https://github.com/tensorflow/models/blob/master/research/deeplab/local_test.sh 1、下载数据 cd models/research/d... 阅读详情

相关推荐

CityScapes数据集

广泛用于计算机视觉任务的城市场景分割数据集,包含来自各个城市街道的高分辨率图像(每个图像都有像素级别的标签,标识不同的物体和场景类别)Cityscapes数据集有fine和coarse两套评测标准,fine提供5000张精细标注的图像,coarse提供5000张精细标注和20000张粗糙标注的图像。一般用gt fine样本集进行训练和评估,图片可分为2975张train训练图、500张val验证图、1525张test测试图,每张图片大小都是1024x2048。

m0_46928770的博客 5227

Cityscapes数据集百度云下载

Cityscapes数据集是一个计算机视觉语义分割数据集,多说无益,百度云链接如下: Cityscapes 需要解压gtFine.zip 没有包含coarse的标注

zym19941119的博客 5万+

用PyTorch复现SegNet语义分割网络:从论文到代码的保姆级实现指南

本文详细介绍了如何使用PyTorch复现SegNet语义分割网络,从论文解析到代码实现的完整流程。SegNet凭借其独特的编码器-解码器设计和池化索引机制,在语义分割任务中表现出色。文章不仅深入解析了SegNet的算法原理,还提供了从数据准备、模型训练到性能优化的实用技巧,帮助开发者快速掌握这一先进的计算机视觉技术。

weixin_30567225的博客 964

无人驾驶常用数据集---图像语义分割数据集--Cityscapes数据集的解读(for 小白)

** 语义分割数据集–Cityscapes数据集的解读(for 小白) ** 一、什么是Cityscapes数据集? Cityscapes是关于城市街道场景的语义理解图片数据集。它主要包含来自50个不同城市的街道场景,拥有5000张在城市环境中驾驶场景的高质量像素级注释图像(其中2975 for train,500 for val, 1525 for test,共有19个类别);此外,它还有20000张粗糙标注的图像(gt coarse)。 二、如何下载该数据集呢? 1、第一步 直接在百度或者谷歌里面搜索C

qq_39350172的博客 3427

基于darknet的图像语义分割算法

基于darknet的图像语义分割算法1、数据集2、网络框架3、网络训练4、结果检测 本文介绍基于darknet的语义分割,代码开源置于网址:https://github.com/zhengshoujian/darknet-yolo-segmentation, 有做相关研究的同学看到开源代码,表示感兴趣并邀我写一篇blog以作分享,如果觉得我的blog有用,请给我的github项目点star,谢谢!...

m0_37726996的博客 3985

cityperson数据集百度网盘下载链接

cityperson数据集百度网盘下载链接

一文概览主要语义分割网络,FCN、UNet、SegNet、DeepLab 等语义分割网络

内容较多,可以传送门直达。新网络待更… 文章目录介绍网络架构Fully Convolution Networks (FCNs) 全卷积网络SegNetU-NetDeepLab v1DeepLab v...

cobank的博客 1360

rk3326 MIPI休眠唤醒黑屏有背光问题

** 1.问题现象: ** **【开机起来】**开机起来可以正常显示 **【按power按键休眠】**第二次按下Power按键进入休眠,隔10s,再按Power按键唤醒。 **【出现结果】**屏幕黑屏有背光,并提示drm time out错 **【lcd信息】**lcd为480*800 2lane的mipi **【复现概率】**第二次按下休眠唤醒必然复现 【具体错误log如下】 //第一次休眠的log// [ 54.858511] dw-mipi-dsi ff450000.dsi: final DSI-

Ian22l的博客 3954

干货 | 一文概览主要语义分割网络,FCN、UNet、SegNet、DeepLab 等等等等应有尽有

干货 | 一文概览主要语义分割网络,FCN、UNet、SegNet、DeepLab 等等等等应有尽有 转载于https://blog.csdn.net/qq_20084101/article/details/80432960 文章目录 介绍 网络架构 Fully Convolution Networks (FCNs) 全卷积网络 SegNet U-Net DeepLab...

ancy的博客 2486

AUTOSAR R20-11标准下载!

这是公众号的第2篇推文,粉丝数49 Document Search Classic Platform Adaptive Platform Foundation 文档截图 以为会在明天的发布会之后才上线,没想到官网现在就悄悄放出来了。 中国由于网络问题,下载速度比较慢或者会中断。 “阅读原文”提供多种下载方式,可以在线浏览,可以集中下载也可单个文档下载。 如有增减我也会及时在公众号里通知大家,不过我觉得不会变动了。 整理不宜,好东西要分...

Adaptive_AUTOSAR的博客 1893

AI大模型应用性能核心指标:TTFT 与 TPOT 详解

这两个指标专门衡量大模型流式响应性能,是评估用户体验的关键指标。· 是什么:从请求到第一个输出的等待时间· 为什么重要:决定用户的第一印象和响应感知· 优化方向:模型加载、预处理、冷启动优化· 行业标准:最好<500ms,可接受<1.5s· 是什么:每个输出token的平均生成时间· 为什么重要:决定流式输出的流畅度和总完成时间· 优化方向:推理引擎、内存带宽、批处理优化· 行业标准:最好<50ms/token,可接受<100ms/token在Dify/大模型应用中的意义。

lovehu6686的博客 4021

【亲测免费】 探索城市景观:Bayesian-SegNet 语义分割与不确定性估计

探索城市景观:Bayesian-SegNet 语义分割与不确定性估计 在计算机视觉领域,语义分割是一项至关重要的任务,尤其是在自动驾驶、城市规划和增强现实等应用中。今天,我们将介绍一个强大的开源项目——Bayesian-SegNet,它不仅提供了高精度的语义分割,还引入了不确定性估计,为深度学习模型提供了更可靠的决策支持。 项目介绍 Bayesian-SegNet 是一个基于 PyTorch 实现...

gitblog_00668的博客 1200

Opencv计算相机响应函数(Camera Response Function)与Radiance

本文主要用于记录自己在学习CRF过程中遇到的一些问题。 CRF模型 I=f(V(t⋅L))I=f(V( t\cdot L))I=f(V(t⋅L)) 其中III为相机灰度值Intensity,LLL为环境中irradiance,ttt为曝光时间,VVV为相机镜头参数,fff为相机响应函数CRF。 有些论文中认为相机镜头参数是线性的不考虑,但有些考虑了衰减即靠近图像边缘亮度会暗一些,但没有看到二者同时计算的,如果同时计算两个非线性的函数,我觉得可能会有不确定性,在这里还请教一下了解的朋友。 控制

larrydong的博客 6005

cityscapes场景图_图像语意分割训练Cityscapes数据集SegNet-ConvNet神经网络详解

版权声明:本文首发于本人CSDN博客。前言:经过将近一个月的陆续学习研究,在神经网络中训练多分类任务识别Cityscapes数据集,终于在最近得到了理想中的实验结果。在我陷入对细节参数调整不当及诸多问题时,苦于没有一篇能够“面向新手编程”的博客。因而我在能够在解决一系列问题到达终点后总结这一路踩过的坑,希望对后来者有所帮助。接下来就是用我得到的神经网络模型结合我所学专业(风景园林)完成小论文,希望...

weixin_28836507的博客 626

YOLOv10注意力革新:小波域注意力(WDA)如何实现多尺度特征精准聚焦

本文深入解析YOLOv10中的小波域注意力(WDA)机制,探讨其如何通过频域分解与动态聚焦实现多尺度特征精准提取。WDA模块结合离散小波变换与注意力机制,显著提升小目标检测性能,在VisDrone数据集上AP提升达12.6%。文章详细介绍了两种集成方案及代码实现,为计算机视觉开发者提供实用指南。

weixin_29079671的博客 258

Python解析骑行fit文件:从数据缺失到完整记录

本文详细介绍了如何利用Python解析和处理骑行FIT文件,解决数据缺失问题。通过使用fitparse库读取二进制FIT文件,并结合Garmin FitCSVTool进行格式转换,指导读者一步步诊断数据完整性、设计心率修补方案,并最终生成完整的骑行记录文件。该方法为骑行爱好者提供了灵活的数据修复与自定义分析能力。

weixin_29062255的博客 460

camvid数据集使用方法_图像语意分割Cityscapes训练数据集使用方法分享

版权声明:本文首发于本人CSDN博客。大家好,这是我的第一篇深度学习分享文章。希望通过写这样一个博客,可以记录我在学习中遇问题并解决问题的过程,若有幸文章对你有所帮助,也就实现了我写这篇文章的意义。若文章有遗误之处,还请大家指正。1.什么是Cityscapes数据集?我们知道,在深度学习图像语意分割的训练过程中,需要有数据集及分好类的标签,这样才可以让你的神经网络进行学习,进而训练出模型,用来识别...

weixin_39605706的博客 796

RK3568/RK3288开发板Ubuntu系统下QT交叉编译环境搭建全攻略(含常见问题解决)

本文详细介绍了在Ubuntu系统下为RK3568和RK3288开发板搭建QT交叉编译环境的完整流程。内容涵盖从基础环境配置、桌面版Qt Creator安装、交叉编译工具链获取与配置,到编译ARM版Qt源码、在Qt Creator中配置交叉编译套件,以及程序部署与远程调试实战。文中还提供了常见问题(如库缺失、运行错误等)的解决方案,旨在帮助开发者高效完成嵌入式QT应用开发。

weixin_29174013的博客 902

Jetson Inference 语义分割实战:使用 segNet 对图像进行逐像素分类(FCN-ResNet18 全卷积网络)

本篇指南聚焦于 jetson-inference 项目中基于 TensorRT 的 `segNet` 语义分割能力:通过将预训练的图像识别骨干网络"全卷积化"(convolutionalizing)为 Fully Convolutional Network(FCN),实现对图像的**逐像素分类**,输出带有类别颜色编码的分割蒙版(mask)与叠加(overlay)效果。读者将掌握如何使用 `seg

gitblog_01187的博客 894

具身智能:原理、算法与系统 第3章 具身智能的感知-认知-行为框架

具身智能的PCB框架源于对生物智能系统的观察:动物通过感官接收环境信息(感知),基于内部模型进行预测和决策(认知),并通过身体执行动作改变环境(行为),而这一改变又通过感知反馈形成闭环。这一框架在两篇核心文献中得到了深入阐述:提出了系统的数学形式化和工程实现,则从认知科学角度强调了归纳偏置和双过程理论的重要性。

VectorShift的博客 161

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

图像分割综述之语义分割

语义分割综述,列举的是经典论文,适合入门的初学者

m0_70140421的博客 6239

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

深度学习应用篇-计算机视觉-语义分割综述[5]:FCN、SegNet、Deeplab等分割算法、常用二维三维半立体数据集汇总、前景展望等

深度学习应用篇-计算机视觉-语义分割综述[5]:FCN、SegNet、Deeplab等分割算法、常用二维三维半立体数据集汇总、前景展望等

丨汀、的博客 6178

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

jetson-inference 语义分割实战:从 DIGITS 无人机数据集标注到 TensorRT 部署的完整流程

本文以 jetson-inference 项目中的语义分割(Semantic Segmentation)能力为主线,完整梳理从 NVIDIA Aerial Drone 航拍数据集准备、DIGITS 导入与 FCN-Alexnet 训练、TensorRT 兼容性修补,到最终在 Jetson 上运行 `segnet` 推理的全过程。读者读完本文后,将掌握基于 DIGITS 构建像素级分类数据集、训练分

gitblog_00852的博客 957

jetson-inference 实战:在 NVIDIA Jetson 上用 segNet 实时运行语义分割摄像头 Demo

本篇技术指南基于 jetson-inference 仓库,讲解如何将 [segnet 示例程序](https://link.gitcode.com/i/d93354993a84b8aad8508c43d9e73727)(C++)与 [segnet.py](https://link.gitcode.com/i/f70d98b0c27f94d7e39deb8ca5b43fa9)(Python)从静态图

gitblog_00303的博客 459
上一篇: d2l函数解析
下一篇: 语义分割网络DeepLabV3在Cityscapes数据集上的探索(上)
松露巧克力手机壳
博客等级 码龄8年 21粉丝 14原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址