Giter Site home page Giter Site logo

mmdetection-wt's Introduction

环境安装:

conda create --name mmlab python=3.8 -y
conda activate mmlab
pip install torch==1.10.1+cu111 torchvision==0.11.2+cu111 torchaudio==0.10.1 -f https://download.pytorch.org/whl/cu111/torch_stable.html
pip install tensorboard
pip install -U openmim
mim install mmengine
mim install "mmcv>=2.0.0"
pip install pycocotools
pip install shapely
pip install terminaltables
pip install scipy

分布式训练

CUDA_VISIBLE_DEVICES=0,1 bash tools/dist_train.sh configs/faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py 2

CUDA_VISIBLE_DEVICES=0,1 bash tools/dist_train.sh configs/yolof/yolof_r50-c5_8xb8-1x_coco.py 2

测试

CUDA_VISIBLE_DEVICES=0 python tools/test.py configs/faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py work_dirs/faster-rcnn_r50_fpn_1x_coco/epoch_300.pth --show-dir show_dir

CUDA_VISIBLE_DEVICES=0 python tools/test.py configs/yolof/yolof_r50-c5_8xb8-1x_coco.py work_dirs/yolof_r50-c5_8xb8-1x_coco/epoch_250.pth --show-dir show_dir

问题

list index out of range

# 在配置文件中添加以下代码
class_name=('xyr', 'rmz', 'qf',"zj","hnpt","bt","fzthxm","hhytj")
num_classes=len(class_name)
metainfo=dict(classes=class_name)
# 然后在train_loader设置metainfo,例如:
train_dataloader = dict(
    batch_size=8, num_workers=8, dataset=dict(pipeline=train_pipeline,metainfo=dict(classes=class_name),))

输出特定iou下的recall

#修改安装的pycocotools下cocoeval.py 的_summarizeDets函数

stats[7] = _summarize(0, maxDets=self.params.maxDets[1])

stats[7] = _summarize(0, iouThr=.5, maxDets=self.params.maxDets[1])


更改标注字体大小和框线大小

#修改文件/mnt/data0/home/wangjiangbo/miniconda3/envs/mmlab/lib/python3.8/site-packages/mmdet/visualization/local_visualizer.py
#注意!不是本项目目录下的mmdet,必须是安装的那个,否则无效
def _draw_instances(self, image: np.ndarray, instances: ['InstanceData'],
                        classes: Optional[List[str]],
                        palette: Optional[List[tuple]])
#修改以下函数调用的参数即可
self.draw_bboxes
self.draw_texts                        

绘制图

#faster-rcnn
python tools/analysis_tools/analyze_logs.py plot_curve work_dirs/faster-rcnn_r50_fpn_1x_coco/20240327_215608/vis_data/scalars.json --keys loss loss_rpn_cls loss_rpn_bbox loss_cls loss_bbox --out losses.pdf --legend  loss loss_rpn_cls loss_rpn_bbox loss_cls loss_bbox

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.