| from datasets import load_dataset | |
| import matplotlib.pyplot as plt | |
| def main(): | |
| ds = load_dataset("DrBimmer/comprehensive-car-damage") | |
| sample = ds["train"][0] | |
| image = sample["image"] | |
| label = sample["label"] | |
| print("Label ID:", label) | |
| print("Label Name:", ds["train"].features["label"].names[label]) | |
| plt.imshow(image) | |
| plt.axis("off") | |
| plt.title(ds["train"].features["label"].names[label]) | |
| plt.show() | |
| if __name__ == "__main__": | |
| main() | |
| # This script loads a sample from the "comprehensive-car-damage" dataset, | |
| # prints its label ID and name, and displays the image using matplotlib. | |