Giter Club home page Giter Club logo

mmkg-sgg's Introduction

图像场景图生成使用说明

1. 算法描述

该算法用于图像场景图生成(SGG)。该算法基于PyTorch框架开发,输入一张图片,算法会检测图片中人和物的交互关系,输出图像场景图。

2. 依赖及安装

CUDA版本: 11.3 其他依赖库的安装命令如下:

conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 -c pytorch -c conda-forge

可使用如下命令下载安装算法包:

pip install -U mmkg-sgg

3. 使用示例及运行参数说明

需要准备 pretrained_ckpt, labelmap_file, freq_prior 三个文件,可以通过 mmkg-sgg 上所提供的链接进行下载

from mmkg_vrd import SGG

sgg = SGG(
    pretrained_ckpt='custom_io/ckpt/RX152FPN_reldn_oi_best.pth',
    labelmap_file='custom_io/ji_vrd_labelmap.json', 
    freq_prior='custom_io/vrd_frequency_prior_include_background.npy', 
)

sgg.det_and_vis(
    img_file='custom_io/imgs/1024px-Gen_Robert_E_Lee_on_Traveler_at_Gettysburg_Pa.jpg',
    save_file='custom_io/out/1024px-Gen_Robert_E_Lee_on_Traveler_at_Gettysburg_Pa.reldn_relation.jpg')

print('all done')

mmkg-sgg's People

Contributors

xu7yue avatar

Stargazers

 avatar

Watchers

 avatar

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.