import os
import matplotlib.pyplot as plt
import random
from PIL import Image
def main(path):
classes = [i for i in os.listdir(path)] # ['cat', 'dog']
# 将所有图片按照 类别:路径 字典形式保存
images_path = [] # [{'cat': './data/train\\cat\\Baidu_0000.jpeg'}, {'cat': './data/train\\cat\\Baidu_0002.jpeg'}]
for cla in classes:
for i in os.listdir(os.path.join(path, cla)):
dic = {} # 类别:图像路径
img_path = os.path.join(path, cla, i)
dic[cla] = img_path # {'cat': './data/train\\cat\\Baidu_0000.jpeg'}
images_path.append(dic)
# 随机展示4张图像
plt.figure(figsize=(12, 8))
for i in range(4):
r = random.randint(0, len(images_path) - 1) # 生成随机数
label, im_path = list(images_path[r].keys())[0], list(images_path[r].values())[0]
# cat , ./data/train\cat\Baidu_0049.jpeg
im = Image.open(im_path)
plt.subplot(2, 2, i + 1)
plt.title(label)
plt.imshow(im)
plt.savefig('show.png') # 保存图片
# plt.show()
if __name__ == '__main__':
root = './data/train' # 传入目录
main(path=root)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【分类个数:7】番茄花叶病毒、tomato_septoria_leaf_spot、tomato_bacterial_spot(详情请查看json字典文件) 如果想可视化数据集,可以运行资源中的show脚本。 【数据集详情】data目录下分为2个目录,训练集和验证集。存放各自的同一类数据图片。训练集图片总数18k左右,验证集图片总数8k左右。 可以用作yolo或者CNN卷积神经网络的深度学习分类数据集 CNN分类网络项目:https://blog.csdn.net/qq_44886601/category_12056269.html
资源推荐
资源详情
资源评论
收起资源包目录
深度学习数据集:7种番茄叶片病害缺陷图像分类(包括划分好的数据【文件夹保存】、类别字典文件、可视化python脚本) (2000个子文件)
748290c1-48f9-46ab-bf30-70db00d1aa76___JR_Sept-L-S-2547_JPG.rf.0fbe979ca2a86c760419bce257ca4546.jpg 27KB
aa233fb1-e0b7-45cc-a5f3-a163b703299e___JR_Sept-L-S-2718_JPG.rf.6503c8926b7988674ae73d3f8e5522ca.jpg 27KB
aa233fb1-e0b7-45cc-a5f3-a163b703299e___JR_Sept-L-S-2718_JPG.rf.d0054267a5317ed2c721947b6fbd21bc.jpg 26KB
748290c1-48f9-46ab-bf30-70db00d1aa76___JR_Sept-L-S-2547_JPG.rf.99e76b0785228cf5c5aee5061c7599e3.jpg 26KB
8ae83365-7729-450a-9a49-328ae36155af___JR_Sept-L-S-2510_JPG.rf.8d9dc87331848eae980dac2d2f2984e2.jpg 26KB
aa233fb1-e0b7-45cc-a5f3-a163b703299e___JR_Sept-L-S-2718_JPG.rf.23cc480eeab63726a1eeb03e85eaa9d8.jpg 26KB
009ce7ca-77de-4e4e-9f59-bec9162df779___Matt-S_CG-7403_JPG.rf.9968efd1b831bc8a27e7faa0ca335c5a.jpg 26KB
c4ffa72c-748c-4697-9034-75abe541f5c7___JR_Sept-L-S-2472_JPG.rf.e19a5a98cdac8853202841a0728c685f.jpg 26KB
5bd0232d-e941-400e-8b38-fa47a26d49a6___JR_Sept-L-S-2544_JPG.rf.149323f81a8d5c52b56a6902bf3e089b.jpg 25KB
a3938779-9d9f-4e45-a397-7b5abd13f6ba___JR_Sept-L-S-2700_JPG.rf.63a8f79f2ea1c0ed3a297c2301ed9645.jpg 25KB
c4ffa72c-748c-4697-9034-75abe541f5c7___JR_Sept-L-S-2472_JPG.rf.02e0ab8324f9e38e527bf7189b652804.jpg 25KB
c4ffa72c-748c-4697-9034-75abe541f5c7___JR_Sept-L-S-2472_JPG.rf.ad202cae24f33e0d9f8d8939c9975ed6.jpg 25KB
5feacc6a-587b-47e0-97cc-91fa25a0087b___JR_Sept-L-S-2685_JPG.rf.c4777f2b7c440b9e2ad28c0ecb2e7b8e.jpg 25KB
95968140-306b-45b7-9bb0-bb475995d29c___JR_Sept-L-S-2580_JPG.rf.ecc933022f0d4753e7b27b0781e10eda.jpg 25KB
a3938779-9d9f-4e45-a397-7b5abd13f6ba___JR_Sept-L-S-2700_JPG.rf.7a6e87d3af4559621808b4d972380604.jpg 25KB
43f78d0c-798d-4466-83f6-49e84d6a9fad___JR_Sept-L-S-2473_JPG.rf.e51408868b72a3388fb4bf89f1645454.jpg 25KB
6a29f136-d22e-470f-9ea1-447c5f3d410d___Matt-S_CG-7471_JPG.rf.8a154fae02390e66a56df72b7e81d402.jpg 25KB
6a29f136-d22e-470f-9ea1-447c5f3d410d___Matt-S_CG-7471_JPG.rf.8e3d70f8650b687ebd6444fa8b06e7b2.jpg 25KB
dc0b3d29-29db-41e3-b93f-3b3b55bfa021___JR_Sept-L-S-2542_JPG.rf.f3b22156aee8d9ddccaff6ffd2a85bc1.jpg 25KB
cbf33493-c9d7-486c-90c7-0e1117aec294___Matt-S_CG-7472_JPG.rf.3452d7e4fed3e5b2eacad7600e91a973.jpg 25KB
4193a3fe-d859-4354-b9e7-ec143f24ca01___JR_Sept-L-S-2579_JPG.rf.1710890469ddb06a5408336af52cdf95.jpg 24KB
95968140-306b-45b7-9bb0-bb475995d29c___JR_Sept-L-S-2580_JPG.rf.a9f37319271ca33776dc8b923d225d4a.jpg 24KB
4193a3fe-d859-4354-b9e7-ec143f24ca01___JR_Sept-L-S-2579_JPG.rf.1e92df2651d5c4e33384a1248b98f1de.jpg 24KB
c06b8139-8834-4755-b335-d1041d082aae___JR_Sept-L-S-2536_JPG.rf.0b4d46dee9b46811f4b3fcbf634ea64a.jpg 24KB
0ca7ed02-4540-47df-b01d-194b23226a2d___Matt-S_CG-1733_JPG.rf.138489ccde593d1e9c5fbd50faba7328.jpg 24KB
0648ab1f-53de-4c70-9854-10f0794cb30c___Matt-S_CG-7480_JPG.rf.08211e81b5d60eb1612b238f5b14a3ad.jpg 24KB
b0db8ed2-d2eb-421a-8159-234f88e0aaa9___Matt-S_CG-7860_JPG.rf.d6a635ea9407d12a279f4f2e3f09fe14.jpg 24KB
9553897f-0b12-4b46-807b-d33c19ade9d9___JR_Sept-L-S-2697_JPG.rf.aa2f0c2a8a09869753d103b0300e021b.jpg 24KB
6a29f136-d22e-470f-9ea1-447c5f3d410d___Matt-S_CG-7471_JPG.rf.948bea5e06dcdb443e2c5a25f00fd845.jpg 24KB
e13e5c45-eab7-4a23-a2bc-3f89fbc7cda6___Matt-S_CG-6879_JPG.rf.4ce5b07a7119e54290c29ff00e43ce6d.jpg 24KB
417da1b3-d80b-4381-b439-bb876b0d3e62___Matt-S_CG-1674_JPG.rf.c31a061b52b2a5313c3479ab841421fb.jpg 24KB
f1e6fb1c-fcd6-4164-963b-0cc10f1bc218___Matt-S_CG-7506_JPG.rf.b184ce354c7d4c1f0e68978bfdf769a8.jpg 24KB
b0db8ed2-d2eb-421a-8159-234f88e0aaa9___Matt-S_CG-7860_JPG.rf.35677e940f14b46db01cc37d5016dd8e.jpg 24KB
cbf33493-c9d7-486c-90c7-0e1117aec294___Matt-S_CG-7472_JPG.rf.dfdb7843567f0b15eead6ffccbfc2db4.jpg 24KB
da1f93df-82fb-47a9-9582-d2dadb97a2a0___JR_Sept-L-S-2649_JPG.rf.467b3549e9cb0b31a39163f02d61a976.jpg 24KB
a0a1df7a-5ffe-42b6-a055-fb19f91add93___Matt-S_CG-7716_JPG.rf.4d83adb1b48c7ed3909bc76bb3ef6d05.jpg 24KB
250522aa-27e8-4238-8a1a-61dc70bb4b9d___Matt-S_CG-7557_JPG.rf.e33479a6f3f726b86918ebc4bf3ad3ac.jpg 24KB
bd7932fa-8fda-4370-baaf-c3b7cef2ac13___JR_Sept-L-S-2572_JPG.rf.3af58acd2b7e3e9063cfba2e07af14ba.jpg 24KB
bd7932fa-8fda-4370-baaf-c3b7cef2ac13___JR_Sept-L-S-2572_JPG.rf.f0a116a3776b09aa2a8e1b9e47291a84.jpg 24KB
2a136f24-b2aa-42c6-b70b-78a95761d863___Matt-S_CG-6884_JPG.rf.bbeee9c5994458ec685a69e0ced6d6a8.jpg 23KB
f1e6fb1c-fcd6-4164-963b-0cc10f1bc218___Matt-S_CG-7506_JPG.rf.1e649874a0e7b6eff5470befcf3236c6.jpg 23KB
b09cc616-1774-4fd0-8d00-c4967daa0e71___JR_Sept-L-S-2698_JPG.rf.5f7486a6d38740dc4fba3124d370be82.jpg 23KB
6c9cd159-1f95-4459-a308-fde523b58c89___Matt-S_CG-7559_JPG.rf.27277ceee14f9467439e3f2476f91642.jpg 23KB
e13e5c45-eab7-4a23-a2bc-3f89fbc7cda6___Matt-S_CG-6879_JPG.rf.0545a46544d52ae916457b239cacf68c.jpg 23KB
250522aa-27e8-4238-8a1a-61dc70bb4b9d___Matt-S_CG-7557_JPG.rf.b522c05aeec7d803100b30fdcae6a78a.jpg 23KB
cc2c7bfd-1c41-470d-91e6-e899126483e7___Matt-S_CG-7387_JPG.rf.6eb05ac88953f618ca68a6151af35344.jpg 23KB
2142a16f-dd81-4045-8ea8-1bb853595821___JR_Sept-L-S-2523_JPG.rf.168fdf1047e1bcfff47208d0c2673beb.jpg 23KB
144f0195-69a2-4bdb-aebb-70f62b2bcff4___Matt-S_CG-7547_JPG.rf.cece86959b2e86758377bf3743b38406.jpg 23KB
fa61de1d-a49d-4e6b-aa12-61be0e1e7fe7___Matt-S_CG-7576_JPG.rf.dd7270b283147e106236d629af24f3e6.jpg 23KB
69624cd3-6e0a-4853-a830-7ad1b67bbcbd___Matt-S_CG-7575_JPG.rf.6a489553b5c9d5adc459245df293058c.jpg 23KB
d37daba6-3681-4b5f-961f-07bef457325f___Matt-S_CG-7522_JPG.rf.e2725efc2578b66451397e21223f9d91.jpg 23KB
be419ce9-4bc5-42fb-87c3-ebabb27321af___JR_Sept-L-S-2638_JPG.rf.03c752fa94d9ac8a11472c2d9e57abcc.jpg 23KB
b09cc616-1774-4fd0-8d00-c4967daa0e71___JR_Sept-L-S-2698_JPG.rf.7a817b393a355cd02db505175b79a5b7.jpg 23KB
382d37d7-8b5c-4e6b-9e6a-b346a0a228a3___Matt-S_CG-7859_JPG.rf.cc8833acabc0853ee329c9b5d4947745.jpg 23KB
e99379ba-b894-4930-bd39-49298c466fec___Matt-S_CG-7492_JPG.rf.e54b82c5565b89e5b1eae24d03463459.jpg 23KB
e99379ba-b894-4930-bd39-49298c466fec___Matt-S_CG-7492_JPG.rf.02e58db5edae8d7d97d41f653e5c7251.jpg 23KB
ac451373-bee8-4c45-b6f8-86c4031062e7___Matt-S_CG-7501_JPG.rf.f204800224f68b19dca13b4c2a0c04eb.jpg 23KB
293f044e-b3e0-452b-aaf3-54e24f137cf1___JR_Sept-L-S-2646_JPG.rf.3b89e6ea4ae6d9960f0243c0fc6ca877.jpg 23KB
256b92d9-41f3-47a4-870f-c0c0f0ac201e___Matt-S_CG-6842_JPG.rf.44c0a50130aafd8861fd3a0ff6575a39.jpg 23KB
3ddb7094-9ee7-473d-8a01-b48ce8eda506___Matt-S_CG-6719_JPG.rf.90d93965416506f748f83cf5b290f8fd.jpg 23KB
76209651-9e68-4431-8ec8-b7483d548089___Matt-S_CG-6761_JPG.rf.ff223841c2a1ee06b525f82ff8d43c33.jpg 23KB
2713743d-6169-4d75-95ae-577b22a663ff___Matt-S_CG-6854_JPG.rf.ba70d98500e5f6678ef1f1a6ffba5277.jpg 23KB
2a136f24-b2aa-42c6-b70b-78a95761d863___Matt-S_CG-6884_JPG.rf.1e6c3d276f88a0577e85ebdbb8c43107.jpg 23KB
97862022-bdbb-4641-b2e7-daa77f5f03d5___JR_Sept-L-S-2553_JPG.rf.da9a6f4e094e0c9c183c09bd98d0b899.jpg 23KB
144f0195-69a2-4bdb-aebb-70f62b2bcff4___Matt-S_CG-7547_JPG.rf.9f906e9de0c0d7da9a2467b1ee22d888.jpg 23KB
4467daac-1e75-4b6f-868d-9dcb5016bd1e___Matt-S_CG-7436_JPG.rf.0014a621ced2422c2ad69bb124502067.jpg 23KB
2b400c69-36a9-4b78-90a0-3702cd38c896___Matt-S_CG-6876_JPG.rf.14aab09988d54a54322c6b7134f0b370.jpg 23KB
9f523eb3-820b-4627-b63a-8904c6b1fca0___Matt-S_CG-6704_JPG.rf.ac055469be3e651621cceacf57d0b4da.jpg 23KB
7e5e84fb-af42-40b6-b2aa-d7e6bc569b1f___Matt-S_CG-7435_JPG.rf.8668cecf846898bd9eb5c64dc8e8556b.jpg 23KB
be419ce9-4bc5-42fb-87c3-ebabb27321af___JR_Sept-L-S-2638_JPG.rf.2df83f27921095b71b117e4d60fab1fa.jpg 23KB
e7eabac8-f9ff-4ec1-b07b-c11791b47bda___Matt-S_CG-1677_JPG.rf.9f65fdbe1571d3a9f3d911ba56a8ce82.jpg 23KB
f9b31399-e5b4-4573-9fd3-9bf2079478c5___JR_Sept-L-S-2723_JPG.rf.17175ccd07faf805ca5061a7c0f1a3b0.jpg 23KB
f9b31399-e5b4-4573-9fd3-9bf2079478c5___JR_Sept-L-S-2723_JPG.rf.3044ec4bc251d7743c1f1a1957c30df3.jpg 23KB
45776444-6428-486a-bb79-c1e1cbde4994___Matt-S_CG-7569_JPG.rf.71dfd954c0fe4ba60d3de7fdc0340fe0.jpg 23KB
d2c083f5-2817-4fe3-b258-da25cbee36d5___Matt-S_CG-7665_JPG.rf.fda16f27ad9062653dbc3bb5b31057e6.jpg 23KB
4155b13b-7c41-494e-8550-497acc32bb83___Matt-S_CG-1706_JPG.rf.882d35deaf4a55ad5c2523b67ebc3b69.jpg 23KB
f23076a1-b482-4370-91c4-6e722a44da8c___Matt-S_CG-7558_JPG.rf.a632d906aeb5239bad2c901f97b7170e.jpg 23KB
fef6e580-b1a6-4093-829d-73472fc5c9f9___Matt-S_CG-7545_JPG.rf.91410820e674d11c82442de3e9d0613b.jpg 23KB
750103c8-a938-49a6-b8af-71eeb7596acb___Matt-S_CG-6872_JPG.rf.3cbadb353048a1e4f209eb3c3422aab3.jpg 23KB
cc2c7bfd-1c41-470d-91e6-e899126483e7___Matt-S_CG-7387_JPG.rf.3d05693da9bb5ceb24811bf6643d99c7.jpg 23KB
4c764c63-9353-46cc-9afb-08de31110043___Matt-S_CG-7535_JPG.rf.430f8c4b07ce79f3ea29415e729aab26.jpg 23KB
9d377ccd-cf2f-4fdb-bce6-ac70e0b53d03___Matt-S_CG-7620_JPG.rf.2326d8202a9f79658f697229dee344e8.jpg 23KB
beeecf7f-1986-4254-aa64-02d0b3a95896___Matt-S_CG-7581_JPG.rf.a244094da316b137a248728cde4a9c1a.jpg 23KB
6c9cd159-1f95-4459-a308-fde523b58c89___Matt-S_CG-7559_JPG.rf.9ecc3fb11c8865c326f641a888a3ec88.jpg 23KB
18f7f428-70e1-42d2-be8f-44e0dab35e17___JR_Sept-L-S-2648_JPG.rf.e831575d49bca4115f5b777e8cd09265.jpg 23KB
086f38cc-ea15-4625-aa96-9a74c65f7f7f___Matt-S_CG-6713_JPG.rf.c882f5eab4de61a424da359abac67a59.jpg 23KB
2713743d-6169-4d75-95ae-577b22a663ff___Matt-S_CG-6854_JPG.rf.093754b9bd6952211d302d232007b97c.jpg 23KB
b634ad06-3f68-47c5-bc70-01c2c690be27___Matt-S_CG-7488_JPG.rf.c0fb8b3b2ab738b69b40613063f0df5c.jpg 23KB
2cf6759a-c628-4861-a83d-b009c83682a2___Matt-S_CG-7674_JPG.rf.60078309c126b67526452437d3a70c57.jpg 23KB
7ca13a8f-089e-4e34-ae62-0cf875d2a2e9___Matt-S_CG-7487_JPG.rf.e1f3b43cc1665a94e414ee44d8e9a054.jpg 23KB
0650f176-add9-444e-893e-707969054a43___JR_Sept-L-S-2722_JPG.rf.f86ad71959020fff472d2714351b1f0d.jpg 23KB
2d9f575c-7ce7-43d7-be22-fbbf53361ba5___Matt-S_CG-6855_JPG.rf.88a17d7de89702497dba17a6992556c9.jpg 23KB
f52594e8-944c-4c02-8bd3-47f98a1cf375___Matt-S_CG-1607_JPG.rf.b7c765c3961893ed9396d405f0616be5.jpg 23KB
256b92d9-41f3-47a4-870f-c0c0f0ac201e___Matt-S_CG-6842_JPG.rf.9026df38055012e4771502a4a9530b98.jpg 23KB
6f0bbcfb-bb4b-465e-a6c4-35e715bea1d2___Matt-S_CG-6686_JPG.rf.f5cfd35bb684f110271c169f7de97974.jpg 23KB
b03fbf6b-8b68-4627-a001-0b81de1be427___JR_Sept-L-S-2503_JPG.rf.eec6a845dadd9cc4d1cee05b5beb33f0.jpg 23KB
18927674-9831-4c32-83ed-7b194445c824___Matt-S_CG-1602_JPG.rf.5728bbef08bbb8ada48a0026e3c15610.jpg 23KB
655548d9-468b-4075-88b6-ba187d4035ec___Matt-S_CG-7549_JPG.rf.d5efd933f35cfa9baf1c3cd7e294779d.jpg 23KB
edab479f-7af4-45ee-ac67-a5874a58ef52___Matt-S_CG-6803_JPG.rf.fe8bb0d7cf4073c3e53f3fac6de786fd.jpg 22KB
3af1fd7b-aca5-405e-b4ab-3615eaa6c0df___Matt-S_CG-6915_JPG.rf.d4271bac60a2232e1a23a46740a50c96.jpg 22KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
听风吹等浪起
- 粉丝: 1w+
- 资源: 1931
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功