Git Product home page Git Product logo

challengerai-mlsv2018's Introduction

challengerai-mlsv2018

This is our attempt to solve real-time multi-label classification challenge organized on AiChallenger by MeiTu company.

Simple baseline is composed of the following steps:

  1. Extract the first frame from each video.
python scripts/video_to_frames.py --ann_file /mnt/ssd1/dataset/short_video_trainingset_annotations.txt.082902 --data_dir /mnt/ssd1/dataset/train/ --out_dir /mnt/ssd1/dataset/train_jpg
python scripts/video_to_frames.py --ann_file /mnt/ssd1/dataset/short_video_validationset_annotations.txt.0829 --data_dir /mnt/ssd1/dataset/val/ --out_dir /mnt/ssd1/dataset/val_jpg
  1. Extract features
CUDA_VISIBLE_DEVICES=0 screen python extract_features.py --ann_file /mnt/ssd1/dataset/new_short_video_validationset_annotations.txt.txt --data_dir /mnt/ssd1/dataset/val_jpg/ --out_dir /mnt/ssd1/dataset/val_features
 CUDA_VISIBLE_DEVICES=0 screen python extract_features.py --ann_file /mnt/ssd1/dataset/new_short_video_trainingset_annotations.txt.txt --data_dir /mnt/ssd1/dataset/train_jpg/ --out_dir /mnt/ssd1/dataset/train_features
  1. Employ lightgbm to classify extracted features
python lightgbm_example.py --train_dir /mnt/ssd1/dataset/train_features/ --val_dir /mnt/ssd1/dataset/val_features/

Network training example

python train_net.py --train_ann_file /mnt/ssd1/dataset/new_short_video_trainingset_annotations.txt.txt --train_data_dir /mnt/ssd1/dataset/train_jpg/ --val_ann_fil
e /mnt/ssd1/dataset/new_short_video_validationset_annotations.txt.txt  --val_data_dir /mnt/ssd1/dataset/val_jpg/ -a se_resnet50

The better way

screen ./scripts/unstable/train_baseline.sh 4 se_resnet50 0.0001 128

Network evaluation example

CUDA_VISIBLE_DEVICES=2 python eval_net.py -b 32 -a se_resnet50 -w /mnt/ssd1/easygold/challengerai-mlsv2018/logs/un_baseline_2018-10-10_16-57-05/checkpoint.pth.tar --ann_fi
le /mnt/ssd1/dataset/short_video_validationset_annotations.txt --data_dir /mnt/ssd1/dataset/val/ -t 1

Tags analysis

Look for the frequence of tags to determine what tags often meet together. May be useful for multilabel analysis.

python tags_analysis.py --ann_file short_video_trainingnset_annotations.txt --out_dir mnt/ssd1/dataser/train_tags_analysis

Meta classifier

Run meta classifier. It is based on majority voting. You can include uo to 5 single model predictions(lightgbm, catboost, log regression, neural network from pickles. Time for one prediction is printed for every model.

CUDA_VISIBLE_DEVICES=2 python infer_meta_classifier.py --train_dir /mnt/ssd1/dataset/multi_class/6_frames_train_se_resnet_merged/ --val_dir /mnt/ssd1/dataset/multi_class/6_frames_val_se_resnet_merged/ -multi_label -val_1_frame -net_pred -lgb -logreg -svm -catboost -voting 

Docker container

Files required for building docker are stored here.

Requirements

Following packages are required to run the code:

  • PyTorch
  • PyAV

challengerai-mlsv2018's People

Contributors

edelbert avatar n01z3 avatar

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.