mmq

mmq project

This repo contains results, notebooks, and code related to quantizing blip2 with various configs. To get an idea of the main logic, look at the below diagram: image

To Edit and Run Repo

To create env, run, and score:

# conda env create -f environment.yml`
python run.py ./configs/1.json
python score.py ./results/1.json

IMPORTANT: The scoring part of this pipeline relies on the pycocoevalcap python submodule. To also clone this into the repo run git clone --recurse-submodules https://github.com/gautomdas/blip2-coco or if you already downloaded the repo and the pycocoevalcap folder is still empty, run git submodule init && git submodule update.

To Recreate the Demo File

  1. Download the coco data set to the data folder using the following script (assumes you have the environment loaded): python download_coco.py
  2. From there you should be able to run all of demo.ipynb
  3. demo.ipynb goes over the 3 main steps in the diagram above

The following files are as follows:

Notebooks

Running TODO

Interesting Results

1082.json:

{
  "predictions": [
    {
      "image_id": 397133,
      "caption": "the new xiaomi mi box"
    },
    {
      "image_id": 37777,
      "caption": "a white and black image of a smartphone"
    },
    {
      "image_id": 252219,
      "caption": "a white and blue box with a black and white logo"
    },
    {
      "image_id": 87038,
      "caption": "a white and black table with a white and black table cloth"
    },
    {
      "image_id": 174482,
      "caption": "an image of a white table with a black and white image"
    },
    {
      "image_id": 403385,
      "caption": "an image of a white wall with a black and white image of a speaker"
    },
    {
      "image_id": 6818,
      "caption": "the new apple tv 4k"
    },
    {
      "image_id": 480985,
      "caption": "a white and black image of a computer screen"
    },
    {
      "image_id": 458054,
      "caption": "a white and black square with a white and black square"
    },
	...
}