Major changes: - New frontend (platform/web/): Vite + React 18 + TypeScript + Tailwind - 4-module navigation: 数据送标 / 模型管理 / 车队管理 / 系统管理 - Data catalog with charts (DMS/ADAS/Lane 3-tab view) - Quality review workflow (标注质检): Good/Fine/Bad scoring with auto-advance - Audit enhancements: batch operations, rejection categories, Feishu notifications - Operation audit log (操作日志) - World model simulation studio (仿真工坊) - Dataset version management with snapshots and diff - ADAS 7-class dataset integration (138K images organized + compressed) - User management with Feishu integration and pagination - CRUD/search/filter on all pages, card layout redesign - PIL-optimized image overlay rendering - Auto-snapshot on build, in_review workflow stage - Removed embedded algorithm code (now in workspace)
76 lines
2.1 KiB
Python
76 lines
2.1 KiB
Python
import os
|
|
import cv2
|
|
import torch
|
|
import torch.nn.parallel
|
|
import torch.backends.cudnn as cudnn
|
|
import argparse
|
|
import numpy as np
|
|
import random
|
|
from clrnet.utils.config import Config
|
|
from clrnet.engine.runner import Runner
|
|
from clrnet.datasets import build_dataloader
|
|
|
|
|
|
def main():
|
|
args = parse_args()
|
|
os.environ["CUDA_VISIBLE_DEVICES"] = ','.join(
|
|
str(gpu) for gpu in args.gpus)
|
|
|
|
cfg = Config.fromfile(args.config)
|
|
cfg.gpus = len(args.gpus)
|
|
|
|
cfg.load_from = args.load_from
|
|
cfg.resume_from = args.resume_from
|
|
cfg.finetune_from = args.finetune_from
|
|
cfg.view = args.view
|
|
cfg.seed = args.seed
|
|
|
|
cfg.work_dirs = args.work_dirs if args.work_dirs else cfg.work_dirs
|
|
|
|
cudnn.benchmark = True
|
|
|
|
runner = Runner(cfg)
|
|
|
|
if args.validate:
|
|
runner.validate()
|
|
elif args.test:
|
|
runner.test()
|
|
else:
|
|
runner.train()
|
|
|
|
|
|
def parse_args():
|
|
parser = argparse.ArgumentParser(description='Train a detector')
|
|
parser.add_argument('config', help='train config file path')
|
|
parser.add_argument('--work_dirs',
|
|
type=str,
|
|
default=None,
|
|
help='work dirs')
|
|
parser.add_argument('--load_from',
|
|
default=None,
|
|
help='the checkpoint file to load from')
|
|
parser.add_argument('--resume_from',
|
|
default=None,
|
|
help='the checkpoint file to resume from')
|
|
parser.add_argument('--finetune_from',
|
|
default=None,
|
|
help='the checkpoint file to resume from')
|
|
parser.add_argument('--view', action='store_true', help='whether to view')
|
|
parser.add_argument(
|
|
'--validate',
|
|
action='store_true',
|
|
help='whether to evaluate the checkpoint during training')
|
|
parser.add_argument(
|
|
'--test',
|
|
action='store_true',
|
|
help='whether to test the checkpoint on testing set')
|
|
parser.add_argument('--gpus', nargs='+', type=int, default='0')
|
|
parser.add_argument('--seed', type=int, default=0, help='random seed')
|
|
args = parser.parse_args()
|
|
|
|
return args
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|