I have started working Helmet Detection problem and decided to train the YOLO model. The very first step is to get a good quality dataset, which I found here on kaggle. The total number of images is 756 in number with their XML files that represent the images. I have decided to add more images and corresponding annotations to the respective images and annotations folders. I have started using roboflow to annotate the images from the web. After downloading two images with their XML annotation, I simply run the following python3 script to check whether the XML annotation is correctly positioned or not.
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from PIL import Image
import xml.etree.ElementTree as ET
# Load your image
# image = Image.open('/home/anil/Pictures/Screenshots/BikesHelmets767.png')
image = Image.open('/home/anil/Downloads/Helmet/archive/images/BikesHelmets3.png')
# image = Image.open('/home/anil/Downloads/BikesHelmets766.png')
# Parse the XML content
xml_content = '''Your XML code'''
root = ET.fromstring(xml_content)
# Extract bounding boxes and labels
boxes = []
for obj in root.findall('object'):
label = obj.find('name').text
bndbox = obj.find('bndbox')
xmin = int(bndbox.find('xmin').text)
ymin = int(bndbox.find('ymin').text)
xmax = int(bndbox.find('xmax').text)
ymax = int(bndbox.find('ymax').text)
boxes.append({'label': label, 'bbox': (xmin, ymin, xmax, ymax)})
# Plot the image
fig, ax = plt.subplots()
ax.imshow(image)
# Plot each bounding box
for box in boxes:
xmin, ymin, xmax, ymax = box['bbox']
rect = patches.Rectangle((xmin, ymin), xmax - xmin, ymax - ymin, linewidth=1, edgecolor='r', facecolor='none')
ax.add_patch(rect)
plt.text(xmin, ymax, box['label'], color='white', verticalalignment='bottom', bbox={'color': 'red', 'pad': 0})
plt.show()
Where xml_content I use the XML code. But what I realize the bounding boxes are not correctly annotated on the images.

But the XML code from the Kaggle data set correctly put the bounding boxes on the corresponding images from the Kaggle data set by using the same python3 script

I am skeptical about the roboflow. Please kindly correct me if I am doing something wrong. Thanks.