Giter Site home page Giter Site logo

mmgraph's Introduction

mmgraph

use torchview to visualize the openmmlab 2.0 model

400+ mmyolo mmdetection models has been visualized, mmrotate、mmclassification models are coming soon.

if you want to visualize your model, you can use the model_visual.ipynb.

# Copyright (c) OpenMMLab. All rights reserved.
import argparse

import torch
from mmengine import Config
from functools import partial

# if you want 
from mmrotate.registry import MODELS
from mmrotate.utils import register_all_modules
register_all_modules()

# from mmdet.registry import MODELS
# from mmdet.utils import register_all_modules
# register_all_modules()
import graphviz


from mmengine.runner import Runner
from torchview import draw_graph
from torchinfo import summary

graphviz.set_default_format('svg')


config = '../mmrotate/configs/rotated_retinanet/rotated-retinanet-rbox-le90_r50_fpn_1x_dota.py'
graph_path = config.replace('mmrotate','model_visual/mmrotate')

cfg = Config.fromfile(config)

dataloader = Runner.build_dataloader(cfg.val_dataloader)

for idx, data_batch in enumerate(dataloader):
    print(idx, data_batch)
    break

model = MODELS.build(cfg.model)
_forward = model.forward

data = model.data_preprocessor(data_batch)
model.forward = partial(_forward, data_samples=data['data_samples'])


summary(model, data['inputs'].shape, depth=3)
# summary(model, (1, 3, 1024, 1024), depth=3)
model_graph = draw_graph(model, input_size=data['inputs'].shape)
model_graph.visual_graph

# model_graph.visual_graph.render(filename=graph_path, view=False, cleanup=True)

mmgraph's People

Contributors

vansin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mmgraph's Issues

welcome update to OpenMMLab 2.0

Looking forward to update to OpenMMLab 2.0

Hello, this issue is intended to guide on how to upgrade from OpenMMLab 1.0 to 2.0.

I'm Vansin, the technical operator of OpenMMLab. Last September, we announced the release of OpenMMLab 2.0 at the World Artificial Intelligence Conference. We invite you to upgrade your algorithm library to OpenMMLab 2.0, which can be used for both research and commercial purposes. If you have any questions, feel free to join us on the OpenMMLab Discord at https://discord.gg/amFNsyUBvm or add my WeChat: van-sin.

Here are the OpenMMLab 2.0 repos branches:

OpenMMLab 1.0 branch OpenMMLab 2.0 branch
MMEngine 0.x
MMCV 1.x 2.x
MMDetection 0.x 、1.x、2.x 3.x
MMAction2 0.x 1.x
MMClassification 0.x 1.x
MMSegmentation 0.x 1.x
MMDetection3D 0.x 1.x
MMEditing 0.x 1.x
MMPose 0.x 1.x
MMDeploy 0.x 1.x
MMTracking 0.x 1.x
MMOCR 0.x 1.x
MMRazor 0.x 1.x
MMSelfSup 0.x 1.x
MMRotate 1.x 1.x
MMYOLO 0.x

Looking forward to update to OpenMMLab 2.0

Looking forward to update to OpenMMLab 2.0

Hello, this issue is intended to guide on how to upgrade from OpenMMLab 1.0 to 2.0.

I'm Vansin, the technical operator of OpenMMLab. Last September, we announced the release of OpenMMLab 2.0 at the World Artificial Intelligence Conference. We invite you to upgrade your algorithm library to this version, which can be used for both research and commercial purposes. If you have any questions, feel free to join us on the OpenMMLab Discord at https://discord.gg/amFNsyUBvm or add me on WeChat: van-sin.

Here are the OpenMMLab 2.0 repos branches:

OpenMMLab 1.0 OpenMMLab 2.0 OpenMMLab 2.0 公测 中文讨论分区
MMEngine 0.x
MMCV 1.x 2.x OpenMMLab 2.0公测中文讨论区之MMCV 2.x
MMDetection 0.x 、1.x、2.x 3.x OpenMMLab 2.0公测中文讨论区之MMDetection 3.x
MMAction2 0.x 1.x OpenMMLab 2.0公测中文讨论区之MMAction2 1.x
MMClassification 0.x 1.x OpenMMLab 2.0公测中文讨论区之MMClassification 1.x
MMSegmentation 0.x 1.x OpenMMLab 2.0公测中文讨论区之MMSegmentation 1.x
MMDetection3D 0.x 1.x OpenMMLab 2.0公测中文讨论区之MMDetection3D 1.1
MMEditing 0.x 1.x OpenMMLab 2.0公测中文讨论区之MMEditing 1.x
MMPose 0.x 1.x OpenMMLab 2.0公测中文讨论区之MMPose 1.x
MMDeploy 0.x 1.x OpenMMLab 2.0公测中文讨论区之MMDeploy dev-1.x
MMTracking 0.x 1.x OpenMMLab 2.0公测中文讨论区之MMTracking 1.x
MMOCR 0.x 1.x OpenMMLab 2.0公测中文讨论区之MMOCR 1.x
MMRazor 0.x 1.x OpenMMLab 2.0公测中文讨论区之MMRazor 1.x
MMSelfSup 0.x 1.x OpenMMLab 2.0公测中文讨论区之MMSelfSup 1.x
MMRotate 1.x 1.x OpenMMLab 2.0公测中文讨论区之MMSelfSup 1.x
MMYOLO 0.x OpenMMLab 2.0公测中文讨论区之MMSelfSup 1.x

Welcome update to OpenMMLab 2.0

Welcome update to OpenMMLab 2.0

I'm Vansin, the technical operator of OpenMMLab. Last September, we announced the release of OpenMMLab 2.0 at the World Artificial Intelligence Conference in Shanghai. We invite you to upgrade your algorithm library to OpenMMLab 2.0 with MMEngine, which can be used for both research and commercial purposes. If you have any questions, feel free to join us on the OpenMMLab Discord at https://discord.gg/amFNsyUBvm or add me on WeChat: van-sin.

Here are the OpenMMLab 2.0 repos branches:

OpenMMLab 1.0 branch OpenMMLab 2.0 branch
MMEngine 0.x
MMCV 1.x 2.x
MMDetection 0.x 、1.x、2.x 3.x
MMAction2 0.x 1.x
MMClassification 0.x 1.x
MMSegmentation 0.x 1.x
MMDetection3D 0.x 1.x
MMEditing 0.x 1.x
MMPose 0.x 1.x
MMDeploy 0.x 1.x
MMTracking 0.x 1.x
MMOCR 0.x 1.x
MMRazor 0.x 1.x
MMSelfSup 0.x 1.x
MMRotate 1.x 1.x
MMYOLO 0.x

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.