vehicle-damage-classifier / src /step2_show_sample.py
efnanaladagg's picture
Clean push
6f6eb85
raw
history blame contribute delete
626 Bytes
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.