Git Product home page Git Product logo

the-taobaolive-commodity-identify-competition's Introduction

Introduce

This is our team's source code of the TaobaoLive Commodity Identify Competition of Tianchi Big Data Platform. Our team PAI got the sixth place in this competition.

Document

The Technical Document (CN-zh)

Object Detection

Configuration File

from config import get_args_efficientdet
opt = get_args_efficientdet()
print(opt)

Data Preparation

from process_data import processTrain, processValidation
label = {}
label['label2index'] = {}
label['index2label'] = {}
processTrain(label)
processValidation(label)

data from [images, videos] is in path data/[train, validation]_[images, videos] and data/[train, validation]_[images, videos]_annotation.json

[train, validation]_[images, videos]_annotation.json

{
    "annotations": [
        {
            "img_name": "{item id}_{frame}.jpg",
            "annotations": [
                {
                    "label": 22,
                    "viewpoint": 0,
                    "display": 1,
                    "instance_id": 0,
                    "box": [221, 507, 614, 1039]
                },
                ...
            ]
        },
        ...
    ]
}

Dataset

from dataset import EfficientdetDataset
dataset = EfficientdetDataset(root_dir, mode, imgORvdo, transform, maxLen, PAD)

EfficientDet

from config import get_args_efficientdet
from efficientdet.efficientdet import EfficientDet
opt = get_args_efficientdet()
model = EfficientDet(opt)

Train EfficientDet

python train_efficientdet.py

Validation EfficientDet

python validation_efficientdet.py

Match

Configuration File

from config import get_args_arcface
opt = get_args_arcface()
print(opt)

Data Preparation

from process_data import processTrain, processValidation
saveNumpyInstance('data', 'train', (256, 256))
saveNumpyInstance('data', 'validation', (256, 256))
createInstance2Label('data')
createInstanceID()

the shape of matrix in data/[train, validation]_instance is $256\times256\times3$

the input of arcface is $3\times224\times224$

Dataset

Arcface

from dataset import ArcfaceDataset
dataset = ArcfaceDataset(root_dir, mode, size, flip_x, maxLen, PAD, imgORvdo)

Triplet Loss

from dataset import TripletDataset
dataset = TripletDataset(root_dir, mode, size, flip_x)

Hard Triplet Loss

from dataset import HardTripletDataset
dataset = HardTripletDataset(root_dir, mode, size, flip_x, n_samples)

Arcface

Backbone

from config import get_args_arcface
from arcface.resnest import ResNeSt
opt = get_args_arcface()
backbone = ResNeSt(opt)

Head

from config import get_args_arcface
from arcface.head import Arcface
opt = get_args_arcface()
head = Arcface(opt)

Train Match Model

Arcface

python train_arcface.py

Triplet Loss

python train_triplet.py

Hard Triplet Loss

python train_hardtriplet.py

Validate Match Model

python validation_arcface.py

Validate with both object detection and match model

python validation_all.py
python cal_score.py

Docker

cd docker

Build

docker build -t image_name .

Push

docker push image_name

Test

nvidia-docker run -v /data/validation_dataset_part1:/tcdata/test_dataset_3w image_name sh run.sh

the-taobaolive-commodity-identify-competition's People

Contributors

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