GithubHelp home page GithubHelp logo

macemoth / hsg-oic Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 191.37 MB

Uses relationships of objects found in images to give them locally unique identifiers in a neurosymbolics-inspired approach

Home Page: https://oicu.netlify.app

Python 100.00%

hsg-oic's Introduction

OIC️

Installation and usage

Submodules

Add the RelTR with the following commands:

git submodule init
git submodule update

Scene Graph

Follow the instructions in the RelTR submodule for installation. RelTR requires Python 3.6.

Symbolic Link (graphene)

Note: graphene can be used within the same environment as the Scene Graph.

  • Run pip3 install -r requirements.txt

  • For example, to run graphene on raw images, use

python3 graphene.py --img_path eval/img/airport
  • To have a data2text export of the temporal graph
python3 graphene.py --img_path eval/img/airport --text graph2text.txt --visual tg.png
  • Or if you already have created graphs, use
python3 graphene.py --graph_path eval/reltr/airport --text graph2text.txt --visual tg.png

Run python3 graphene.py --help for synopsis on graphene

QA interface

Note: tflight-support requires a Python version newer than RelTR and can therefore not be used with the same Python version as graphene.

  • cd inference
  • Optional: create conda environment or virtual environment with a Python 3.9 or higher
  • Run pip3 install -r requirements.txt
  • Download Albert weights, rename them to albert_metadata.tflite and place them into qa/ckpt
  • If the data2text export (done with --text in graphene) is scene.txt and the temporal graph plot (done with --visual) is scene.png, start the server with python3 server.py ../out/scene.txt ../out/scene.png and open http://127.0.0.1:5000 in your browser

Data handling

Frame extraction

To extract frames from a video, you can use

python3 utils/extractframes.py path_to_video frames_per_second

Demo data

We provide demo images and preprocessed frame graphs (to be used with --graph_path option) in eval/img and eval/reltr, respectively.

Directory structure

IMP-OIC
| 
└───dataset (Helper files to train RelTR)
└───eval
|  └───img (Images for evaluation)
|  └───reltr (Completed scene graph from RelTR, can be used with --graph-path)
|  └───vid (Original videos, can be converted to frames with extractframes.py)
|  └───yolo (YOLO classification results)
└───inference (Language model QA)
└───out (Generated for results)
└───RelTR (Submodule)
└───structures (Datastructures for the symbolic link)
└───utils (Helper files)
... 

Common errors

Directory not empty: temp

Solution: Delete the temp directory located in the root directory.

The temp directory is created for storing the scene graph descriptions obtained from RelTR in JSON format. For tests, they can be directly used with the --graph_path option and are not deleted automatically.

RelTR is not running

Note that RelTR requires Python 3.6 and Tensorflow libraries that are specific for CPU or CUDA-compatible GPUs. Follow the installation instructions of the RelTR submodule. Note that weights have to be downloaded for RelTR (see installation instructions).

The QA system does not work

The ALBERT language model is dependent on the tflite-support library that requires a Python version newer than ~3.8 and is furthermore not available for Windows. Furthermore, it requires a metadata file (see installation instructions).

hsg-oic's People

Contributors

macemoth avatar yasmineantille 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.