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.
The Technical Document (CN-zh)
from config import get_args_efficientdet
opt = get_args_efficientdet()
print(opt)
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]
},
...
]
},
...
]
}
from dataset import EfficientdetDataset
dataset = EfficientdetDataset(root_dir, mode, imgORvdo, transform, maxLen, PAD)
from config import get_args_efficientdet
from efficientdet.efficientdet import EfficientDet
opt = get_args_efficientdet()
model = EfficientDet(opt)
python train_efficientdet.py
python validation_efficientdet.py
from config import get_args_arcface
opt = get_args_arcface()
print(opt)
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
the input of arcface is
from dataset import ArcfaceDataset
dataset = ArcfaceDataset(root_dir, mode, size, flip_x, maxLen, PAD, imgORvdo)
from dataset import TripletDataset
dataset = TripletDataset(root_dir, mode, size, flip_x)
from dataset import HardTripletDataset
dataset = HardTripletDataset(root_dir, mode, size, flip_x, n_samples)
from config import get_args_arcface
from arcface.resnest import ResNeSt
opt = get_args_arcface()
backbone = ResNeSt(opt)
from config import get_args_arcface
from arcface.head import Arcface
opt = get_args_arcface()
head = Arcface(opt)
python train_arcface.py
python train_triplet.py
python train_hardtriplet.py
python validation_arcface.py
python validation_all.py
python cal_score.py
cd docker
docker build -t image_name .
docker push image_name
nvidia-docker run -v /data/validation_dataset_part1:/tcdata/test_dataset_3w image_name sh run.sh