five

Stanford-Cars

收藏
魔搭社区2025-12-05 更新2025-09-13 收录
下载链接:
https://modelscope.cn/datasets/HuggingFaceM4/Stanford-Cars
下载链接
链接失效反馈
官方服务:
资源简介:
## Code snippet to visualise the position of the box ```python import matplotlib.image as img import matplotlib.pyplot as plt from datasets import load_dataset from matplotlib.patches import Rectangle # Load dataset ds_name = "SaulLu/Stanford-Cars" ds = load_dataset(ds_name, use_auth_token=True) # Extract information for the sample we want to show index = 100 sample = ds["train"][index] box_coord = sample["bbox"][0] img_path = sample["image"].filename # Create plot # define Matplotlib figure and axis fig, ax = plt.subplots() # plot figure image = img.imread(img_path) ax.imshow(image) # add rectangle to plot ax.add_patch( Rectangle((box_coord[2], box_coord[0]), box_coord[3] - box_coord[2], box_coord[1] - box_coord[0], fill=None) ) # display plot plt.show() ``` Result: ![Sample with box position](data_readme/sample_100_box_pos.png)

## 用于可视化边界框位置的代码片段 python import matplotlib.image as img import matplotlib.pyplot as plt from datasets import load_dataset from matplotlib.patches import Rectangle # 加载数据集 ds_name = "SaulLu/Stanford-Cars" ds = load_dataset(ds_name, use_auth_token=True) # 提取待展示样本的相关信息 index = 100 sample = ds["train"][index] # 获取样本的边界框(bounding box,bbox)坐标 box_coord = sample["bbox"][0] img_path = sample["image"].filename # 创建绘图对象 # 定义Matplotlib画布与坐标轴 fig, ax = plt.subplots() # 读取并绘制图像 image = img.imread(img_path) ax.imshow(image) # 向绘图区域添加矩形框 ax.add_patch( Rectangle((box_coord[2], box_coord[0]), box_coord[3] - box_coord[2], box_coord[1] - box_coord[0], fill=None) ) # 展示绘制结果 plt.show() 结果: ![带边界框的样本](data_readme/sample_100_box_pos.png)
提供机构:
maas
创建时间:
2025-08-01
5,000+
优质数据集
54 个
任务类型
进入经典数据集
二维码
社区交流群

面向社区/商业的数据集话题

二维码
科研交流群

面向高校/科研机构的开源数据集话题

数据驱动未来

携手共赢发展

商业合作