Comments (4)
finally I found the way.
- Convert your own dataset to coco-format
- put the dataset folder in, or link it to "./datasets/ ". "." is the working directory where you execute train_net.py
the structure should be:
--datasets
| |--coco
| | |--annotations
| | | |--instances_train2017.json
| | | |--instances_val2017.json
| | |--train2017
| | | |--[put your train images here]
| | |--val2017
| | | |--[put your val images here]
(pay attention to folder name and annotation json file name) - find the path of Detecton2 (search your python site-packages)
and then find detectron2/data/datasets/builtin_meta.py
locate the method named " _get_coco_instances_meta()"
comment all the code beforereturn ret
and insert your own code
def _get_coco_instances_meta():
#thing_ids = [k["id"] for k in COCO_CATEGORIES if k["isthing"] == 1]
#thing_colors = [k["color"] for k in COCO_CATEGORIES if k["isthing"] == 1]
#assert len(thing_ids) == 80, len(thing_ids)
## Mapping from the incontiguous COCO category id to an id in [0, 79]
#thing_dataset_id_to_contiguous_id = {k: i for i, k in enumerate(thing_ids)}
#thing_classes = [k["name"] for k in COCO_CATEGORIES if k["isthing"] == 1]
#ret = {
# "thing_dataset_id_to_contiguous_id": thing_dataset_id_to_contiguous_id,
# "thing_classes": thing_classes,
# "thing_colors": thing_colors,
#}
ret = {
"thing_dataset_id_to_contiguous_id": {your class id mapping}
# for example : {0:0, 1:1}
"tining_classes": [your class names]
# for example : ["person", "bird"]
"thing_colors": [color for different class]
# for example : [[0, 255, 0], [255, 0, 0]]
return ret
- run train_net.py in your working directory.
from adelaidet.
@toxic-0518 Thank you for your question. We directly make use of the data loader in detectron2, so you can refer to the document of detectron2 to know how to use your own data.
from adelaidet.
ok, I'll look into detectron2 dataloader.
Thank you!
from adelaidet.
@toxic-0518 thank you very much for sharing it here:-).
from adelaidet.
Related Issues (20)
- How do we understand '_C' in adet? HOT 4
- FileNotFoundError: [Errno 2] No such file or directory: 'datasets/totaltext/weak_voc_new.txt'
- AsyncPredictor cost more time
- Blendmask changes the bifpn problem HOT 2
- detectron2的注册机制 HOT 1
- Hi,how to determine the control points of Bezier curve when generating Bezier curve for polygonal label curved text? HOT 1
- ABCNetv2 long text detect
- Why dice smoothing only applied in denominator?
- 对于文本不是正的Bazier曲线拉直
- Installation issue on google colab HOT 4
- RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu) when run demo.py in colab HOT 2
- when training boxinst,the pairwise loss is increasing,why? HOT 1
- Keyerror in convert_fcos_weights.py
- About the problem that the picture is blurred after biezeralign processing
- export the model into torchscript
- How can i install on cpu?
- _pickle.UnpicklingError: invalid load key, '<'. HOT 1
- How to do model.pth to model.pt , HOT 1
- ABCNet data clockwise ? HOT 2
- train_net.py not saving .pth file to output/batext/totaltext/attn_R_50 directory
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adelaidet.