首页 > 其他分享 >MMpretrain使用Tiny ImageNet数据集

MMpretrain使用Tiny ImageNet数据集

时间:2024-10-28 14:31:13浏览次数:7  
标签:... wagon bear jpg cat Tiny ImageNet MMpretrain

Tiny ImageNet是ImageNet的子集,ImageNet太大了,训练一次要好几天,于是准备用Tiny ImageNet代替ImageNet.

/mmpretrain/mmpretrain/datasets/imagenet.py里面列出了ImageNet的两种格式:

        imagenet
        ├── train
        │   ├──class_x
        |   |   ├── x1.jpg
        |   |   ├── x2.jpg
        |   |   └── ...
        │   ├── class_y
        |   |   ├── y1.jpg
        |   |   ├── y2.jpg
        |   |   └── ...
        |   └── ...
        ├── val
        │   ├──class_x
        |   |   └── ...
        │   ├── class_y
        |   |   └── ...
        |   └── ...
        └── test
            ├── test1.jpg
            ├── test2.jpg
            └── ...

或者:

        imagenet
        ├── train
        │   ├── x1.jpg
        │   ├── y1.jpg
        │   └── ...
        ├── val
        │   ├── x3.jpg
        │   ├── y3.jpg
        │   └── ...
        ├── test
        │   ├── test1.jpg
        │   ├── test2.jpg
        │   └── ...
        └── meta
            ├── train.txt
            └── val.txt

编写一个python小程序将解压后的Tiny ImageNet转化为上面两种格式种的任意一种即可:

修改/mmpretrain/mmpretrain/datasets/categories.py文件,在里面加上下面的类列表:

TINY_IMAGENET_CATEGORIES = (
    'Egyptian cat',
    'reel',
    'volleyball',
    'rocking chair, rocker',
    'lemon',
    'bullfrog, Rana catesbeiana',
    'basketball',
    'cliff, drop, drop-off',
    'espresso',
    "plunger, plumber's helper",
    'parking meter',
    'German shepherd, German shepherd dog, German police dog, alsatian',
    'dining table, board',
    'monarch, monarch butterfly, milkweed butterfly, Danaus plexippus',
    'brown bear, bruin, Ursus arctos',
    'school bus',
    'pizza, pizza pie',
    'guinea pig, Cavia cobaya',
    'umbrella',
    'organ, pipe organ',
    'oboe, hautboy, hautbois',
    'maypole',
    'goldfish, Carassius auratus',
    'potpie',
    'hourglass',
    'seashore, coast, seacoast, sea-coast',
    'computer keyboard, keypad',
    'Arabian camel, dromedary, Camelus dromedarius',
    'ice cream, icecream',
    'nail',
    'space heater',
    'cardigan',
    'baboon',
    'snail',
    'coral reef',
    'albatross, mollymawk',
    "spider web, spider's web",
    'sea cucumber, holothurian',
    'backpack, back pack, knapsack, packsack, rucksack, haversack',
    'Labrador retriever',
    'pretzel',
    'king penguin, Aptenodytes patagonica',
    'sulphur butterfly, sulfur butterfly',
    'tarantula',
    'lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens',
    'pop bottle, soda bottle',
    'banana',
    'sock',
    'cockroach, roach',
    'projectile, missile',
    'beer bottle',
    'mantis, mantid',
    'freight car',
    'guacamole',
    'remote control, remote',
    'European fire salamander, Salamandra salamandra',
    'lakeside, lakeshore',
    'chimpanzee, chimp, Pan troglodytes',
    'pay-phone, pay-station',
    'fur coat',
    'alp',
    'lampshade, lamp shade',
    'torch',
    'abacus',
    'moving van',
    'barrel, cask',
    'tabby, tabby cat',
    'goose',
    'koala, koala bear, kangaroo bear, native bear, Phascolarctos cinereus',
    'bullet train, bullet',
    'CD player',
    'teapot',
    'birdhouse',
    'gazelle',
    "academic gown, academic robe, judge's robe",
    'tractor',
    'ladybug, ladybeetle, lady beetle, ladybird, ladybird beetle',
    'miniskirt, mini',
    'golden retriever',
    'triumphal arch',
    'cannon',
    'neck brace',
    'sombrero',
    'gasmask, respirator, gas helmet',
    'candle, taper, wax light',
    'desk',
    'frying pan, frypan, skillet',
    'bee',
    'dam, dike, dyke',
    'spiny lobster, langouste, rock lobster, crawfish, crayfish, sea crawfish',
    'police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria',
    'iPod',
    'punching bag, punch bag, punching ball, punchball',
    'beacon, lighthouse, beacon light, pharos',
    'jellyfish',
    'wok',
    'potter\'s wheel',
    'sandal',
    'pill bottle',
    'butcher shop, meat market',
    'slug',
    'hog, pig, grunter, squealer, Sus scrofa',
    'cougar, puma, catamount, mountain lion, painter, panther, Felis concolor',
    'crane',
    'vestment',
    "dragonfly, darning needle, devil's darning needle, sewing needle, snake feeder, snake doctor, mosquito hawk, skeeter hawk",
    'cash machine, cash dispenser, automated teller machine, automatic teller machine, automated teller, automatic teller, ATM',
    'mushroom',
    'jinrikisha, ricksha, rickshaw',
    'water tower',
    'chest',
    'snorkel',
    'sunglasses, dark glasses, shades',
    'fly',
    'limousine, limo',
    'black stork, Ciconia nigra',
    'dugong, Dugong dugon',
    'sports car, sport car',
    'water jug',
    'suspension bridge',
    'ox',
    'ice lolly, lolly, lollipop, popsicle',
    'turnstile',
    'Christmas stocking',
    'broom',
    'scorpion',
    'wooden spoon',
    'picket fence, paling',
    'rugby ball',
    'sewing machine',
    'steel arch bridge',
    'Persian cat',
    'refrigerator, icebox',
    'barn',
    'apron',
    'Yorkshire terrier',
    'swimming trunks, bathing trunks',
    'stopwatch, stop watch',
    'lawn mower, mower',
    'thatch, thatched roof',
    'fountain',
    'black widow, Latrodectus mactans',
    'bikini, two-piece',
    'plate',
    'teddy, teddy bear',
    'barbershop',
    'confectionery, confectionary, candy store',
    'beach wagon, station wagon, wagon, estate car, beach waggon, station waggon, waggon',
    'scoreboard',
    'orange',
    'flagpole, flagstaff',
    'American lobster, Northern lobster, Maine lobster, Homarus americanus',
    'trolleybus, trolley coach, trackless trolley',
    'drumstick',
    'dumbbell',
    'brass, memorial tablet, plaque',
    'bow tie, bow-tie, bowtie',
    'convertible',
    'bighorn, bighorn sheep, cimarron, Rocky Mountain bighorn, Rocky Mountain sheep, Ovis canadensis',
    'orangutan, orang, orangutang, Pongo pygmaeus',
    'American alligator, Alligator mississipiensis',
    'centipede',
    'syringe',
    'go-kart',
    'brain coral',
    'sea slug, nudibranch',
    'cliff dwelling',
    'mashed potato',
    'viaduct',
    'military uniform',
    'pomegranate',
    'chain',
    'kimono',
    'comic book',
    'trilobite',
    'bison',
    'pole',
    'boa constrictor, Constrictor constrictor',
    'poncho',
    'bathtub, bathing tub, bath, tub',
    'grasshopper, hopper',
    'walking stick, walkingstick, stick insect',
    'Chihuahua',
    'tailed frog, bell toad, ribbed toad, tailed toad, Ascaphus trui',
    'lion, king of beasts, Panthera leo',
    'altar',
    'obelisk',
    'beaker',
    'bell pepper',
    'bannister, banister, balustrade, balusters, handrail',
    'bucket, pail',
    'magnetic compass',
    'meat loaf, meatloaf',
    'gondola',
    'standard poodle',
    'acorn',
    'lifeboat',
    'binoculars, field glasses, opera glasses',
    'cauliflower',
    'African elephant, Loxodonta africana')

最后,将相关模型文件里面的num_classes从1000改成200,就可以运行了.

标签:...,wagon,bear,jpg,cat,Tiny,ImageNet,MMpretrain
From: https://www.cnblogs.com/mstk/p/18510556

相关文章

  • BEVDet-Tiny复现Nuscenes-Mini数据集
    论文地址:https://arxiv.org/abs/2112.11790项目地址:https://github.com/HuangJunJie2017/BEVDet在anaconda中创建虚拟环境并启动condacreatebevdet_ckptpython=3.7-y进入虚拟环境condaactivatebevdet_ckpt阅读论文,想要复现BEVDet的Tiny版本,在原作者的Github最新bra......
  • Minecraft 1.21.1游戏服务器运维笔记1:Ubuntu 18.04.6折腾Fabric配置及TinyRemapper、s
    摘要本文叙述了如何在Linux服务器上通过完全命令行交互的方式配置基于Minecraft1.21.1版本的Fabric服务器,交代了环境配置流程,以及服务端文件、模组文件的下载方法,给出了命令行操作方式以及完整的游戏启动脚本。目录摘要背景需求前瞻知识及材料准备准备工作环境配置操作系......
  • 几行代码带你用TinyEngine低代码引擎开发侧边栏插件
    本文分享自华为云社区《实操上手TinyEngine低代码引擎插件化开发》,作者:OpenTiny。1.背景介绍1.1TinyEngine低代码引擎简介低代码开发是近些年非常热门的一种开发方式,用户可以通过可视化的方式,简单拖拽,不写代码或者编写少量代码,类似搭积木一样搭建业务应用。TinyEngine是一个......
  • tinyMce编辑器的使用(本地引用的方式)
     本地引用,可以免费使用,没有次数限制 项目存放位置:index.html页面:<!--tinymce编辑器--><scriptsrc="<%=BASE_URL%>tinymce/tinymce.min.js"type="text/javascript"></script> tinyMce.vue组件页面内容<template><div><tex......
  • 轻量级模型,重量级性能,TinyLlama、LiteLlama小模型火起来了
    前言当大家都在研究大模型(LLM)参数规模达到百亿甚至千亿级别的同时,小巧且兼具高性能的小模型开始受到研究者的关注。小模型在边缘设备上有着广泛的应用,如智能手机、物联网设备和嵌入式系统,这些边缘设备通常具有有限的计算能力和存储空间,它们无法有效地运行大型语言模型。因此,深入探......
  • 极度精简 Winows11 系统镜像!Tiny11 2311下载 - 支持苹果 M 芯片 Mac 安装 (ARM 精简版
    最新推出的Tiny11是一款极端精简版Windows11系统镜像,针对苹果M芯片Mac用户(ARM架构)提供良好支持。Tiny11内置了众多优化特性,如更小的安装体积和更快的启动速度,特别适合有特殊需求或老机型的用户。用户可以通过下载操作系统镜像文件,并借助专业的系统安装工具,如软碟通......
  • Datawhile 组队学习Tiny-universe Task01
    Task01:LLama3模型讲解仓库链接:GitHub-datawhalechina/tiny-universe:《大模型白盒子构建指南》:一个全手搓的Tiny-Universe参考博客:LLaMA的解读与其微调(含LLaMA2):Alpaca-LoRA/Vicuna/BELLE/中文LLaMA/姜子牙_llama微调-CSDN博客https://zhuanlan.zhihu.com/p/694072728......
  • 828华为云征文 | 云服务器Flexus X实例:轻量级http服务器 Tinyhttpd 部署
    目录一、云服务器Flexus二、Tinyhttpd介绍三、部署Tinyhttpd四、运行4.1编译项目4.2运行项目五、总结Flexus云服务器X实例是华为云推出的一款高性能、高可靠性的云服务器产品,它专为满足企业级用户对计算资源的严格要求而设计。本篇文章通过部署 轻量级http服务......
  • Datawhale------Tiny-universe学习笔记——Qwen
    1.Qwen整体介绍    对于一个完全没接触过大模型的小白来说,猛一听这个名字首先会一懵:Qwen是啥。这里首先解答一下这个问题。下面是官网给出介绍:Qwen是阿里巴巴集团Qwen团队研发的大语言模型和大型多模态模型系列。其实随着大模型领域的发展,这类产品已经有很多了例如:由......
  • thinkphp5数据库迁移工具 migration(longtext/tinyint等)
    我用tp5创建文件phpthinkmigrate:createUser在User文件里面写publicfunctionup(){$this->table('a3')->addColumn('a','integer',['limit'=>'10','default'=>0,'signed'=&......