Open hustzlb opened 3 years ago
Detectron2官方给的示例代码有添加自定义COCO数据集的方法,不需要去改代码https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5#scrollTo=PIbAM2pv-urF,使用register_coco_instances注册就行了。
Detectron2官方给的示例代码有添加自定义COCO数据集的方法,不需要去改代码https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5#scrollTo=PIbAM2pv-urF,使用register_coco_instances注册就行了。
from detectron2.data.datasets import register_coco_instances register_coco_instances("my_dataset_train", {}, "./datasets/coco/annotations/instances_train2017.json", "./datasets/coco/train2017") register_coco_instances("my_dataset_val", {}, "json_annotation_val.json", "datasets/coco")
from detectron2.structures import BoxMode
import torch, torchvision
import detectron2 from detectron2.utils.logger import setup_logger setup_logger()
import numpy as np import os, json, cv2, random
from detectron2 import model_zoo from detectron2.engine import DefaultPredictor from detectron2.config import get_cfg from detectron2.utils.visualizer import Visualizer from detectron2.data import MetadataCatalog, DatasetCatalog
import time
MetadataCatalog.get("my_dataset_train").thing_classes = ["crack", "desquamation", "scratch", "edgeCrack"] from detectron2.engine import DefaultTrainer
cfg = get_cfg()
cfg.merge_from_file(model_zoo.get_config_file("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")) cfg.DATASETS.TRAIN = ("my_dataset_train",) cfg.DATASETS.TEST = () cfg.DATALOADER.NUM_WORKERS = 2 cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml") # Let training initialize from model zoo cfg.SOLVER.IMS_PER_BATCH = 8 cfg.SOLVER.BASE_LR = 0.00025 # pick a good LR cfg.SOLVER.MAX_ITER = 300 # 300 iterations seems good enough for this toy dataset; you will need to train longer for a practical dataset cfg.SOLVER.STEPS = [] # do not decay learning rate cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE = 128 # faster, and good enough for this toy dataset (default: 512) cfg.MODEL.ROI_HEADS.NUM_CLASSES = 4 # only has one class (ballon). (see https://detectron2.readthedocs.io/tutorials/datasets.html#update-the-config-for-new-datasets)
能帮我分析一下是什么原因吗?
from detectron2.data.datasets import register_coco_instances register_coco_instances("my_dataset_train", {}, "./datasets/coco/annotations/instances_train2017.json", "./datasets/coco/train2017") register_coco_instances("my_dataset_val", {}, "json_annotation_val.json", "datasets/coco")
你可以试试把这个加到train_net.py 前面
我是用自己做的coco数据集,我的数据集只有4类,我并没有引入新的扩展数据集,直接按照coco的格式放到默认数据集下,然后在adet/config/defaults.py中将所有分类为80的换成4,在D2/d2/data/builtin_meta.py中COCO_CATEGORIES = 改成我自己的,assert len(thing_ids) == 80, len(thing_ids)这些也改成4,训练能跑起来,跑了25000圈,我用demo测试,结果啥都测不出来,还有哪些地方需要改呢?还是我改错了?有哪位大神告诉我一下!
你好,请问你的问题解决了没有,能用condinst预测了么
我的能运行起来,但是效果并没有论文里说的那么好,我觉着远不如mask rcnn,修改参数的话,我刚你找找我是怎么改的,你等我上午面试完的
发自我的 iPhone
在 2021年9月27日,上午9:42,Yszzz-z @.***> 写道:
我是用自己做的coco数据集,我的数据集只有4类,我并没有引入新的扩展数据集,直接按照coco的格式放到默认数据集下,然后在adet/config/defaults.py中将所有分类为80的换成4,在D2/d2/data/builtin_meta.py中COCO_CATEGORIES = 改成我自己的,assert len(thing_ids) == 80, len(thing_ids)这些也改成4,训练能跑起来,跑了25000圈,我用demo测试,结果啥都测不出来,还有哪些地方需要改呢?还是我改错了?有哪位大神告诉我一下!
你好,请问你的问题解决了没有,能用condinst预测了么
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
我的能运行起来,但是效果并没有论文里说的那么好,我觉着远不如mask rcnn,修改参数的话,我刚你找找我是怎么改的,你等我上午面试完的 发自我的 iPhone … 在 2021年9月27日,上午9:42,Yszzz-z @.***> 写道: 我是用自己做的coco数据集,我的数据集只有4类,我并没有引入新的扩展数据集,直接按照coco的格式放到默认数据集下,然后在adet/config/defaults.py中将所有分类为80的换成4,在D2/d2/data/builtin_meta.py中COCO_CATEGORIES = 改成我自己的,assert len(thing_ids) == 80, len(thing_ids)这些也改成4,训练能跑起来,跑了25000圈,我用demo测试,结果啥都测不出来,还有哪些地方需要改呢?还是我改错了?有哪位大神告诉我一下! 你好,请问你的问题解决了没有,能用condinst预测了么 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
我的能运行起来,但是效果并没有论文里说的那么好,我觉着远不如mask rcnn,修改参数的话,我刚你找找我是怎么改的,你等我上午面试完的 发自我的 iPhone … 在 2021年9月27日,上午9:42,Yszzz-z @.***> 写道: 我是用自己做的coco数据集,我的数据集只有4类,我并没有引入新的扩展数据集,直接按照coco的格式放到默认数据集下,然后在adet/config/defaults.py中将所有分类为80的换成4,在D2/d2/data/builtin_meta.py中COCO_CATEGORIES = 改成我自己的,assert len(thing_ids) == 80, len(thing_ids)这些也改成4,训练能跑起来,跑了25000圈,我用demo测试,结果啥都测不出来,还有哪些地方需要改呢?还是我改错了?有哪位大神告诉我一下! 你好,请问你的问题解决了没有,能用condinst预测了么 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
请问可以留个联系方式么,能不能有偿请教一些问题
这个网络我研究的也不多,搭建就花了很长时间,最后跑实验感觉效果也不好,后来就没有再弄,你问的问题我可能都不会😂😂😂
发自我的 iPhone
在 2021年9月27日,上午9:52,Yszzz-z @.***> 写道:
我的能运行起来,但是效果并没有论文里说的那么好,我觉着远不如mask rcnn,修改参数的话,我刚你找找我是怎么改的,你等我上午面试完的 发自我的 iPhone … 在 2021年9月27日,上午9:42,Yszzz-z @.***> 写道: 我是用自己做的coco数据集,我的数据集只有4类,我并没有引入新的扩展数据集,直接按照coco的格式放到默认数据集下,然后在adet/config/defaults.py中将所有分类为80的换成4,在D2/d2/data/builtin_meta.py中COCO_CATEGORIES = 改成我自己的,assert len(thing_ids) == 80, len(thing_ids)这些也改成4,训练能跑起来,跑了25000圈,我用demo测试,结果啥都测不出来,还有哪些地方需要改呢?还是我改错了?有哪位大神告诉我一下! 你好,请问你的问题解决了没有,能用condinst预测了么 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
我的能运行起来,但是效果并没有论文里说的那么好,我觉着远不如mask rcnn,修改参数的话,我刚你找找我是怎么改的,你等我上午面试完的 发自我的 iPhone … 在 2021年9月27日,上午9:42,Yszzz-z @.***> 写道: 我是用自己做的coco数据集,我的数据集只有4类,我并没有引入新的扩展数据集,直接按照coco的格式放到默认数据集下,然后在adet/config/defaults.py中将所有分类为80的换成4,在D2/d2/data/builtin_meta.py中COCO_CATEGORIES = 改成我自己的,assert len(thing_ids) == 80, len(thing_ids)这些也改成4,训练能跑起来,跑了25000圈,我用demo测试,结果啥都测不出来,还有哪些地方需要改呢?还是我改错了?有哪位大神告诉我一下! 你好,请问你的问题解决了没有,能用condinst预测了么 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
请问可以留个联系方式么,能不能有偿请教一些问题
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
我就是在搭建和训练这里有很多问题😂
下午的吧,一会我要面试了
发自我的 iPhone
在 2021年9月27日,上午9:55,Yszzz-z @.***> 写道:
我就是在搭建和训练这里有很多问题😂
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
好滴
你把你联系方式发给我一份
发自我的 iPhone
在 2021年9月27日,上午9:57,Yszzz-z @.***> 写道:
好滴
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
我的能跑起来,效果并没有论文里说的那么好,我觉着远不如面具 rcnn,修改参数的话,我刚你找我是怎么改的,你等我早上面试的发完自我的苹果手机 … 在 2021年9月27日,上午9:42,Yszzz-z @.***> 写道: 我是用自己做的coco数据集,我的数据集只有4类,我并没有引入新的扩展数据集,直接按照coco的格式放到默认数据集下,然后在adet/config/defaults.py中将所有分类为80的换成4,在D2/d2/data/builtin_meta.py中COCO_CATEGORIES = 改成我自己的,assert len(thing_ids) == 80, len(thing_ids)这些也改成4,训练能跑起来,跑了25000圈,我用demo测试,结果啥都测不出来,还有哪些地方需要改呢?还是我改错了?有哪位大神告诉我一下! 你好,请问你的问题解决了没有,能用condinst预测了么 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
我也遇到了condinst的效果没有maskrcnn好的效果,请问您这个问题解决了吗?
没有呀,没再弄,本来打算写在论文里,后来时间来不及就不弄了,从此再也不会做图像了,我毕业了,哈哈哈哈
发自我的 iPhone
在 2022年4月12日,下午2:55,baimaoyoumo @.***> 写道:
我的能跑起来,效果并没有论文里说的那么好,我觉着远不如面具 rcnn,修改参数的话,我刚你找我是怎么改的,你等我早上面试的发完自我的苹果手机 … 在 2021年9月27日,上午9:42,Yszzz-z @.***> 写道: 我是用自己做的coco数据集,我的数据集只有4类,我并没有引入新的扩展数据集,直接按照coco的格式放到默认数据集下,然后在adet/config/defaults.py中将所有分类为80的换成4,在D2/d2/data/builtin_meta.py中COCO_CATEGORIES = 改成我自己的,assert len(thing_ids) == 80, len(thing_ids)这些也改成4,训练能跑起来,跑了25000圈,我用demo测试,结果啥都测不出来,还有哪些地方需要改呢?还是我改错了?有哪位大神告诉我一下! 你好,请问你的问题解决了没有,能用condinst预测了么 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
我也遇到了condinst的效果没有maskrcnn好的效果,请问您这个问题解决了吗?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.
我是用自己做的coco数据集,我的数据集只有4类,我并没有引入新的扩展数据集,直接按照coco的格式放到默认数据集下,然后在adet/config/defaults.py中将所有分类为80的换成4,在D2/d2/data/builtin_meta.py中COCO_CATEGORIES = 改成我自己的,assert len(thing_ids) == 80, len(thing_ids)这些也改成4,训练能跑起来,跑了25000圈,我用demo测试,结果啥都测不出来,还有哪些地方需要改呢?还是我改错了?有哪位大神告诉我一下!