detectron2 中的coco數據集默認位置更改


detectron2 中的coco數據集默認位置更改

其默認的dataset的位置是 .../detectron2/data/datasets/...

更改方式

打開上述路徑下的buildin.py文件

# -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved

"""
This file registers pre-defined datasets at hard-coded paths, and their metadata.

We hard-code metadata for common datasets. This will enable:
1. Consistency check when loading the datasets
2. Use models on these standard datasets directly and run demos,
   without having to download the dataset annotations

We hard-code some paths to the dataset that's assumed to
exist in "./datasets/". #其默認位置為"./datasets/"

Users SHOULD NOT use this file to create new dataset / metadata for new dataset.
To add new dataset, refer to the tutorial "docs/DATASETS.md".
"""

更改最下面的函數:

# Register them all under "./datasets"
_root = os.getenv("DETECTRON2_DATASETS", "/media/code/T1/") #更改DATASETS的值
register_all_coco(_root)
register_all_lvis(_root)
register_all_cityscapes(_root)
register_all_pascal_voc(_root)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM