enet语义分割数据集问题

首先,目前为止我们数据可以采集了,但是图像标定问题,因为enet,PSPnet之类的使用的都是用灰度值标记的图片信息,和labelme的不一样。

https://blog.csdn.net/yuzihao12/article/details/90379358类似的找labelMe的教程先安装好,然后启动就可以了。标记很容易。

 

上图就是lableme的效果,labelme标记之后生成的是一个json文件

https://blog.csdn.net/aaon22357/article/details/86407625

这个博客链接好像可以 我没有仔细看,感觉可以。要不你帮我看看。

反正最后是要根据NYU40标签生成对应的二值图,图片还有标签,你那里有的对吧,只要按灰度和词表弄出来就好了。

https://blog.csdn.net/heiheiya/article/details/88342597这个的结果

 

https://blog.csdn.net/qq_36190978/article/details/95139599这个也可以参考

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
OpenCV Python中有一个预训练的ENet语义分割模型,可以用于对图像进行像素级别的分类和分割ENet是一种轻量级的神经网络结构,可以在较短的时间内完成图像分割任务,并且具有较高的准确性和效率。 要使用预训练的ENet模型,需要先安装OpenCV和相应的Python包。然后,可以使用以下代码加载模型并对图像进行分割: ```python import cv2 import numpy as np # Load the model net = cv2.dnn.readNet('enet-model.net') # Load the image img = cv2.imread('image.jpg') # Resize the image to the input size of the network input_size = (1024, 512) img_resized = cv2.resize(img, input_size) # Normalize the image img_normalized = img_resized / 255.0 # Create a blob from the image blob = cv2.dnn.blobFromImage(img_normalized, scalefactor=1.0, size=input_size, mean=(0, 0, 0), swapRB=True, crop=False) # Set the input to the network net.setInput(blob) # Run a forward pass through the network output = net.forward() # Get the class probabilities for each pixel in the image class_probs = output[0] # Get the class predictions for each pixel in the image class_preds = np.argmax(class_probs, axis=0) # Convert the class predictions to a color image class_colors = [[0, 0, 0], [255, 0, 0], [0, 255, 0], [0, 0, 255]] # Define the colors for each class class_img = np.zeros((input_size[1], input_size[0], 3), dtype=np.uint8) for i in range(input_size[1]): for j in range(input_size[0]): class_img[i, j] = class_colors[class_preds[i, j]] # Resize the class image back to the original image size class_img_resized = cv2.resize(class_img, (img.shape[1], img.shape[0])) # Show the original image and the segmented image side by side cv2.imshow('Original Image', img) cv2.imshow('Segmented Image', class_img_resized) cv2.waitKey(0) ``` 这段代码首先加载了ENet模型,然后加载了一张图像。接下来,将图像缩放到网络的输入大小,并将像素值归一化到0到1的范围内。然后,将图像转换为网络的输入blob,将其设置为网络的输入,并通过网络进行前向传递。输出是每个像素的类概率,可以使用argmax函数获取每个像素的类预测。最后,将类预测转换为彩色图像,并将其调整为原始图像的大小,然后将原始图像和分割图像显示在一起。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值