
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Autocare DeepLearning Toolkit은 SNUAILAB의 모델 개발 및 Autocare T의 학습을 지원하기 위한 pytorch 기반 deep learning toolkit입니다.
git clone git@github.com:snuailab/autocare_dlt.git
cd autocare_dlt
pip install -r requirements.txt
pip install autocare_dlt
autocare_dlt.tools.train.run(exp_name: str, model_cfg: str, data_cfg: str, gpus: str = '0', ckpt: ~typing.Union[str, dict] = None, world_size: int = 1, output_dir: str = 'outputs', resume: bool = False, fp16: bool = False, ema: bool = False)→ tooNone
Run training
Parameters
exp_name (str) – experiment name. a folder with this name will be created in the output_dir
, and the log files will be saved there.
model_cfg (str) – path for model configuration file
data_cfg (str) – path for dataset configuration file
gpus (str, optional) – GPU IDs to use. Default to ‘0’
ckpt (str, optional) – path for checkpoint file. Defaults to None.
world_size (int, optional) – world size for ddp. Defaults to 1.
output_dir (str, optional) – log output directory. Defaults to ‘outputs’.
resume (bool, optional) – whether to resume the previous training or not. Defaults to False.
fp16 (bool, optional) – whether to use float point 16 or not. Defaults to False.
ema (bool, optional) – whether to use EMA(exponential moving average) or not. Defaults to False.
autocare_dlt.tools.inference.run(inputs: str, model_cfg: str, output_dir: str, gpus: str, ckpt: Union[str, dict], input_size: list = None, letter_box: bool = None, vis: bool = False, save_imgs: bool = False, root_dir: str = '')→ None
Run inference
Parameters
inputs (str) – path for input - image, directory, or json
model_cfg (str) – path for model configuration file
output_dir (str) – path for inference results
gpus (str) – GPU IDs to use
ckpt (Union[str, dict]) – path for checkpoint file or state dict
input_size (list, optional) – input size of model inference. Defaults to [640].
letter_box (bool, optional) – whether to use letter box or not. Defaults to False.
vis (bool, optional) – whether to visualize inference in realtime or not. Defaults to False.
save_imgs (bool, optional) – whether to draw and save inference results as images or not. Defaults to False.
root_dir (str, optional) – path for input image when using json input. Defaults to “”.
autocare_dlt.tools.eval.run(model_cfg: str, data_cfg: str, gpus: str, ckpt: Union[str, dict])→ None
Evaluate a model
Parameters
model_cfg (str) – path for model configuration file
data_cfg (str) – path for dataset configureation file
gpus (str) – GPU IDs to use
ckpt (Union[str, dict]) – path for checkpoint file or state dict
autocare_dlt.tools.export_onnx.run(output_name: str, model_cfg: str, ckpt: Union[str, dict], input_size: list = None, opset: int = 11, no_onnxsim: bool = False)→ None
Export onnx file
Parameters
output_name (str) – file name for onnx output (.onnx)
model_cfg (str) – path for model configuration file
ckpt (Union[str, dict]) – path for checkpoint file or state dict
input_size (list, optional) – input size of model. use model config value if input_size is None. Default to None.
opset (int, optional) – onnx opset version. Defaults to 11.
no_onnxsim (bool, optional) – whether to use onnxsim or not. Defaults to False.
autocare_dlt.tools.data_selection.run(model_cfg: str, ckpt: Union[str, dict], inputs: str, num_outputs: int, output_dir: str, gpus: str, input_size: list = None, letter_box: bool = None, copy_img: bool = False, root_dir: str = '')→ None
Select active learning data
Parameters
model_cfg (str) – path for model configuration file
ckpt (Union[str, dict]) – path for checkpoint file or state dict
inputs (str) – path for input - image, directory, or json
num_outputs (int) – number of images to select
output_dir (str) – path for output result
gpus (str) – GPU IDs to use
input_size (list, optional) – input size of model inference. Defaults to [640].
letter_box (bool, optional) – whether to use letter box or not. Defaults to False.
copy_img (bool, optional) – whether to copy images to output. Defaults to False.
root_dir (str, optional) – path for input image when using json input. Defaults to “”.
autocare_dlt.tools.hpo.run(exp_name: str, model_cfg: str, data_cfg: str, hpo_cfg: str = None gpus: str = '0', ckpt: ~typing.Union[str, dict] = None, world_size: int = 1, output_dir: str = 'outputs', resume: bool = False, fp16: bool = False, ema: bool = False)→ None
Run Hyperparameter Optimization
Parameters
exp_name (str) – experiment name. a folder with this name will be created in the output_dir
, and the log files will be saved there.
model_cfg (str) – path for model configuration file
data_cfg (str) – path for dataset configuration file
hpo_cfg (str, optional): path for hpo configuration file. Default to None.
gpus (str, optional) – GPU IDs to use. Default to ‘0’
ckpt (str, optional) – path for checkpoint file. Defaults to None.
world_size (int, optional) – world size for ddp. Defaults to 1.
output_dir (str, optional) – log output directory. Defaults to ‘outputs’.
resume (bool, optional) – whether to resume the previous training or not. Defaults to False.
fp16 (bool, optional) – whether to use float point 16 or not. Defaults to False.
ema (bool, optional) – whether to use EMA(exponential moving average) or not. Defaults to False.
Supervised Learning
python autocare_dlt/tools/train.py --exp_name {your_exp} --model_cfg {path}/{model}.json --data_cfg {path}/{data}.json} --ckpt {path}/{ckpt}.pth --gpus {gpu #}
Multi-GPU 훈련을 진행하기 위해서는 'python'이 아닌 'torchrun'을 이용해야 함
torchrun autocare_dlt/tools/train.py --exp_name {your_exp} --model_cfg {path}/{model}.json --data_cfg {path}/{data}.json} --ckpt {path}/{ckpt}.pth --gpus {gpu #,#,...} --multi_gpu True
[권장] 같은 서버에서 다수의 Multi-GPU 훈련을 하기 위해서는 아래 명령어를 이용해야 함
torchrun --rdzv_backend=c10d --rdzv_endpoint=localhost:0 --nnodes=1 autocare_dlt/tools/train.py --exp_name {your_exp} --model_cfg {path}/{model}.json --data_cfg {path}/{data}.json} --ckpt {path}/{ckpt}.pth --gpus {gpu #,#,...}
python autocare_dlt/tools/eval.py --model_cfg {path}/{model}.json --data_cfg {path}/{data}.json} --ckpt {path}/{ckpt}.pth --gpus 0
python autocare_dlt/tools/export_onnx.py --output_name {path}/{model_name}.onnx --model_cfg {path}/{model}.json --batch_size 1 --ckpt {path}/{ckpt}.pth
python tools/inference.py --inputs {path}/{input_dir, img, video, coco json} --model_cfg {path}/{model}.json --output_dir {path}/{output dir name} --ckpt {path}/{model_name}.pth --input_size {width} {height} --gpus {gpu_id} (optional)--root_dir {root path of coco}
python tools/data_selection.py --inputs {path}/{input_dir, cocojson} --model_cfg {path}/{model}.json --output_dir {path}/{output dir name} --ckpt {path}/{model_name}.pth --num_outputs {int} --input_size {width} {height} --letter_box {bool} --gpus {gpu_id} (optional)--root_dir {root path of coco}
This code is based on and inspired on those repositories (TBD)
FAQs
Autocare Tx Model
We found that autocare-dlt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.