Code Monkey home page Code Monkey logo

bsdet's Introduction

BSDet: Binary Similarity Detector


Quick Start

1. Check Requirements

  • Linux with Python >= 3.6
  • PyTorch >= 1.6 & torchvision that matches the PyTorch version.
  • CUDA 10.1, 10.2, 11.0 (maybe even higher)
  • GCC >= 4.9

2. Build BSDet

  • Clone Code
  • Create a virtual environment (optional)
    conda create -n bsdet python=3.7
    source activate bsdet
    
  • Install PyTorch with CUDA
    conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=11.0 -c pytorch
    
  • Install Detectron2
    python3 -m pip install detectron2==0.3 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu110/torch1.7/index.html
    
  • Install other requirements
    python3 -m pip install -r requirements.txt
    

3. Prepare Data

  • Refer to DeFRCN and TFA
  • The final dataset file structure is as follows:
    ...
    datasets
      | -- coco
            | -- trainval2014/*.jpg
            | -- val2014/*.jpg
            | -- annotations/*.json
      | -- cocosplit
      | -- VOC2007
      | -- VOC2012
      | -- vocsplit
    defrcn
    tools
    ...
    

4. Config Files


  • BSDet config files:
    configs 
      | -- coco_CosSimNegHead
      | -- voc_CosSimNegHead
    

5. Training and Evalution

  • VOC

    bash run_voc.sh
    
    • EXP_NAME: save directory
    • CONFIG_NAME: used config directory
    • SPLIT_ID: id of voc split
    • GPUS: number of used GPUs
  • COCO

    bash run_coco.sh
    
    • EXP_NAME: save directory
    • CONFIG_NAME: used config directory
    • GPUS: number of used GPUs

6. Test

  • VOC

    bash test_voc.sh
    
    • CONFIG_NAME: used config directory
    • CHECKPOINT: used checkpoint
    • shot: number of novel class samples
    • SPLIT_ID: id of voc split
    • GPUS: number of used GPUs
  • COCO

    bash test_coco.sh
    
    • CONFIG_NAME: used config directory
    • CHECKPOINT: used checkpoint
    • shot: number of novel class samples
    • GPUS: number of used GPUs

7. FSOD Test Setting

There are two main types of FSOD test, single test and multiple test. We adopt the single test (such as MPSR). It is worth noting that DeFRCN has two fine-tuning settings: one predicts only novel classes during fine-tuning (fsod), and the other predicts both base classes and novel classes (gfsod). To remain consistent with other existing works (such as MPSR), we use the gfsod setting. In addition, we only run novel class samples with seed 0, as it is consistent with the samples used in existing single-test works. The mAP of DeFRCN compared in the paper comes from DeFRCN (the result of seed 0 in the log file), therefore it is not consistent with the mAP reported in the DeFRCN paper. However, this is a fair comparison.

Acknowledgement

This repo is developed based on DeFRCN and Detectron2. Please check them for more details and features.

bsdet's People

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.