Skip to content

Conversation

@DerrickUnleashed
Copy link
Contributor

This PR adds two datasets:
pascal_segmentation_dataset() and pascal_detection_dataset()

Closes #139

@DerrickUnleashed
Copy link
Contributor Author

DerrickUnleashed commented Aug 1, 2025

@cregouby the original website is down. http://host.robots.ox.ac.uk/pascal/VOC/ When I researched upon it, it seems it is a regular occurence so, I have switched the urls to make sure there is continuous support.

PING host.robots.ox.ac.uk (129.67.94.152): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
7 packets transmitted, 0 packets received, 100.0% packet loss

@DerrickUnleashed
Copy link
Contributor Author

pascal_seg <- pascal_segmentation_dataset(transform = transform_to_tensor, download = TRUE)
# Access the first image and its mask
first_item <- pascal_seg[1]
first_item$x  # Image
first_item$y$masks  # Segmentation mask
# Visualise the first image and its mask
masked_img <- draw_segmentation_masks(first_item)
tensor_image_browse(masked_img)
image
pascal_det <- pascal_detection_dataset(transform = transform_to_tensor, download = TRUE)
# Access the first image and its bounding boxes
first_item <- pascal_det[1]
first_item$x  # Image
first_item$y$labels  # Object labels
first_item$y$boxes  # Bounding box tensor
# Visualise the first image with bounding boxes
boxed_img <- draw_bounding_boxes(first_item)
tensor_image_browse(boxed_img)
image

@DerrickUnleashed DerrickUnleashed marked this pull request as ready for review August 1, 2025 13:22
@DerrickUnleashed
Copy link
Contributor Author

DerrickUnleashed commented Aug 1, 2025

@cregouby This PR is ready for review.

@cregouby cregouby self-requested a review August 1, 2025 16:46
Copy link
Collaborator

@cregouby cregouby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise Nice shoot, with very effective example. Thanks !
todo see inline

Copy link
Collaborator

@cregouby cregouby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo major performance improvement is needed. Some hints are included.

Copy link
Collaborator

@cregouby cregouby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise This is much better now. Thanks for the update
todo see inline

Comment on lines 84 to 89
classes = c(
"background", "aeroplane", "bicycle", "bird", "boat", "bottle",
"bus", "car", "cat", "chair", "cow", "diningtable", "dog",
"horse", "motorbike", "person", "pottedplant", "sheep",
"sofa", "train", "tvmonitor"
),
Copy link
Collaborator

@cregouby cregouby Aug 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo could you switch to classes=voc_segmentation_classes as currently there are inconsistencies with yours :
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 classes = c(
   "background", "aeroplane", "bicycle", "bird", "boat", "bottle",
   "bus", "car", "cat", "chair", "cow", "dining table", "dog",
   "horse", "motorbike", "person", "potted plant", "sheep",
   "sofa", "train", "tv"
 ),

Copy link
Contributor Author

@DerrickUnleashed DerrickUnleashed Aug 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made the above change. It would help if I knew where the voc_segmentation_classes are from so I can make them consistent.

@cregouby cregouby merged commit a20adbe into mlverse:main Aug 8, 2025
3 checks passed
@DerrickUnleashed DerrickUnleashed deleted the feat/pascalDatasets branch August 11, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dataset] Add Pascal VOC Datasets for image detection and segmentation

2 participants