Giter Site home page Giter Site logo

rapcap's Introduction

Implementation for PraCap

Read this in other languages: 中文.

Data

Download the dataset JSON files for COCO and Flickr30k that have been pre-split according to the Karparthy split. Create folders with the corresponding dataset names, each containing 'images' and 'text' subfolders. Place the downloaded JSON files in the 'text' subfolder. Put the two dataset folders in the 'data' directory at the root path.

├─data
│  ├─coco
│  │  ├─images
│  │  └─text
│  ├─flickr30k
│  │  ├─images
│  │  └─text

Preprocess

Start by running 'dataset_split.py' in the 'preprocess' directory to obtain the training set, validation set, and test set. After completion, execute 'text_features_extraction.py' in the same directory, paying attention to the parameters of these two files. This will generate .pkl files for the corresponding datasets in the 'preprocess_out' directory.

Create a folder named "others" in the root directory, and then run the method get_support_memory from utils.py.

Training

Run 'train_cpac_simtexts.py' and pay attention to the parameter specifying the dataset required for training.

Inference

First, save the downloaded images in the directory data//images/. Then, run 'image_features_extraction.py' in the 'preprocess' folder to obtain image features. After completion, run 'eval_cpac_simtexts.py' to obtain scores for various evaluation metrics. Pay attention to the parameters when running these scripts.

rapcap's People

Contributors

hjinbo avatar

Watchers

Kostas Georgiou avatar  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.