Неправильные метки в наборе данных SVHN?Python

Программы на Python
Ответить
Anonymous
 Неправильные метки в наборе данных SVHN?

Сообщение Anonymous »

Я экспериментировал с набором данных SVHN, в основном я хотел обрезать каждую цифру перед некоторым обучением, когда случайно заметил, что изображение 53.png из тестового набора данных имеет неправильные метки (9 и 3, вместо 3 и 3).
Мне интересно, может ли кто-нибудь повторить эту проблему, и если ярлыки действительно неправильные, возможно, подскажет, что с этим делать?Я скачал набор данных с официального сайта, разархивировал его и попробовал прочитать digitStruct.mat.
мой код (при условии, что все данные находятся в папке data/train):

Код: Выделить всё

import os
from PIL import Image
from pymatreader import read_mat
import matplotlib.pyplot as plt
train_mat = read_mat('data/train/digitStruct.mat')

print(train_mat['digitStruct']['name'][52])
print(train_mat['digitStruct']['bbox'][52])
Возвраты

Код: Выделить всё

>>53.png
>>{'label': [9.0, 3.0], 'height': [84.0, 84.0], 'width': [59.0, 52.0], 'left': [160.0, 208.0], 'top': [34.0, 18.0]}
Я также пробовал отображать другие изображения на случай подобных аномалий, но ничего не заметил.

Код: Выделить всё

import cv2
from matplotlib import pyplot as plt

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

# Read the images using OpenCV (OpenCV loads images in BGR format)
image1 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][0])
image2 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][27])
image3 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][52])
image4 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][90])

# Convert the images from BGR to RGB format so Matplotlib can display them correctly
image1 = cv2.cvtColor(image1, cv2.COLOR_BGR2RGB)
image2 = cv2.cvtColor(image2, cv2.COLOR_BGR2RGB)
image3 = cv2.cvtColor(image3, cv2.COLOR_BGR2RGB)
image4 = cv2.cvtColor(image4, cv2.COLOR_BGR2RGB)

# Add the first image to the figure (top-left position)
plt.subplot(2, 2, 1)  # 2 rows, 2 columns, first position
plt.imshow(image1)
plt.axis('off')  # Hide the axis labels
plt.title(train_mat['digitStruct']['name'][0] + '\n' + str(train_mat['digitStruct']['bbox'][0]['label']))

# Add the second image to the figure (top-right position)
plt.subplot(2, 2, 2)  # 2 rows, 2 columns, second position
plt.imshow(image2)
plt.axis('off')  # Hide the axis labels
plt.title(train_mat['digitStruct']['name'][27] + '\n' + str(train_mat['digitStruct']['bbox'][27]['label']))

# Add the third image to the figure (bottom-left position)
plt.subplot(2, 2, 3)  # 2 rows, 2 columns, third position
plt.imshow(image3)
plt.axis('off')  # Hide the axis labels
plt.title(train_mat['digitStruct']['name'][52] + '\n' + str(train_mat['digitStruct']['bbox'][52]['label']))
# Add the fourth image to the figure (bottom-right position)
plt.subplot(2, 2, 4)  # 2 rows, 2 columns, fourth position
plt.imshow(image4)
plt.axis('off')  # Hide the axis labels
plt.title(train_mat['digitStruct']['name'][90] + '\n' + str(train_mat['digitStruct']['bbox'][90]['label']))
Результат: сравнение SVHN

Подробнее здесь: https://stackoverflow.com/questions/792 ... hn-dataset
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Python»