File size: 626 Bytes
6f6eb85 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
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.
|