MIL.pytorch icon indicating copy to clipboard operation
MIL.pytorch copied to clipboard

PyTorch implementation of Multiple-instance learning

PyTorch implementation of Multiple-instance learning

Updates

  • [ ] Training/Testing on MS COCO
  • [x] Testing on Openimages, object detection and classification
  • [x] Testing on single image

About

This repository contains the MIL implementation for the experiments in:

https://github.com/s-gupta/visual-concepts

If you want to use the original caffe implementation, pls follow the instructions below:

git clone [email protected]:s-gupta/caffe.git code/caffe
cd code/caffe
git checkout mil
make -j 16
make pycaffe
cd ../../

Or, you can use the transformed PyTorch model of mine. You can download them from Tencent Weiyun or Google Drive. Files included in that directory are:

model/coco_valid1_eval.pkl
model/mil.pth

Test results

You can change the url in test.py to your testing image. Then run:

python test.py
test0
['beach', 'dog', 'brown', 'standing', 'people', 'his', 'sandy', 'white', 'sitting', 'laying']
[1.0, 0.62, 0.62, 0.5, 0.45000000000000001, 0.42999999999999999, 0.37, 0.35999999999999999, 0.34000000000000002, 0.28000000000000003]
test1
['cat', 'sink', 'sitting', 'black', 'bathroom', 'white', 'top', 'sits', 'counter', 'looking']
[1.0, 0.68000000000000005, 0.56999999999999995, 0.56000000000000005, 0.39000000000000001, 0.34999999999999998, 0.31, 0.26000000000000001, 0.23000000000000001, 0.22]