Giter Site home page Giter Site logo

tirg-bonnfurniture's Introduction

Retrieving Furniture Image and Style with TIRG

by Jeffrey Braga, Doris Chia-ching Lin

This project is an attempt to use TIRG function for image retrieval with a new furniture style dataset. The original code was published with the following paper:

Composing Text and Image for Image Retrieval - An Empirical Odyssey
Nam Vo, Lu Jiang, Chen Sun, Kevin Murphy, Li-Jia Li, Li Fei-Fei, James Hays
CVPR 2019. github code source

The dataset was published with the paper below:

Learning Style Compatibility for Furniture
Divyansh Aggarwal, Elchin Valiyev, Fadime Sener, and Angela Yao
CVPR 2018. dataset download

Implementation

In order to implement TIRG for the furniture style dataset, we have created test_queries.txt to map the index of source image and target image for image retrieval. Each image has captions which can be cross-referenced with testing queries. Here are our dataset stats:

Train Model

  • FurnitureStyle: 133346 images
  • 56520 unique captions
  • Modifiable images 40076

Test Model

  • FurnitureStyle: 28812 images
  • 28812 test queries

Setup

  • torchvision
  • pytorch
  • numpy
  • tqdm
  • tensorboardX
  • Python 3.0.0 or above

Hardware Requirement:

Running Models

  • main.py: driver script to run training/testing
  • datasets.py: Dataset classes for loading images & generate training retrieval queries
  • text_model.py: LSTM model to extract text features
  • img_text_composition_models.py: various image text compostion models (described in the paper)
  • torch_function.py: contains soft triplet loss function and feature normalization function
  • test_retrieval.py: functions to perform retrieval test and compute recall performance

FurnitureStyle dataset

Download our generated test_queries.txt from here.

Make sure the dataset include these files:

<dataset_path>/splits/*.txt
<dataset_path>/houzz/<category>/<style>/*.jpeg
<dataset_path>/test_queries.txt`

note that the file name val_split in /splits/ from origin dataset should be renamed to test_val_split

Run training & testing:

python main.py --dataset=furnitureStyle --dataset_path=./furniture-style \
  --num_iters=160000 --model=concat --loss=batch_based_classification \
  --learning_rate_decay_frequency=50000 --comment=furnitureS_concat

python3 main.py --dataset=furnitureStyle --dataset_path=./furniture-style \
  --num_iters=160000 --model=tirg --loss=batch_based_classification \
  --learning_rate_decay_frequency=50000 --comment=furnitureS_tirg

tirg-bonnfurniture's People

Contributors

bragajj avatar

Stargazers

 avatar  avatar  avatar

Watchers

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