数据集放在 datasets/coco_minitrain_10k
数据集目录结构如下:
datasets/
└── coco_mintrain_10k/
├── annotations/
│ ├── instances_train2017.json
│ ├── instances_val2017.json
│ ├── ... (其他标注文件)
├── train2017/
│ ├── 000000000001.jpg
│ ├── ... (其他训练图像)
├── val2017/
│ ├── 000000000001.jpg
│ ├── ... (其他验证图像)
└── test2017/
├── 000000000001.jpg
├── ... (其他测试图像)
conda creaet -n yolo11_py310 python=3.10
conda activate yolo11_py310
pip install -U -r train/requirements.txt
先下载预训练权重:
bash 0_download_wgts.sh
执行预测测试:
bash 1_run_predict_yolo11.sh
预测结果保存在 runs
文件夹下,效果如下:
已经准备好一键训练肩膀,直接执行训练脚本:
bash 2_run_train_yolo11.sh
其中其作用的代码很简单,就在 train/train_yolo11.py
中,如下:
# Load a model
model = YOLO(curr_path + "/wgts/yolo11n.pt")
# Train the model
train_results = model.train(
data= curr_path + "/cfg/coco128.yaml", # path to dataset YAML
epochs=100, # number of training epochs
imgsz=640, # training image size
device="0", # device to run on, i.e. device=0 or device=0,1,2,3 or device=cpu
)
# Evaluate model performance on the validation set
metrics = model.val()
主要就是配置一下训练参数,如数据集路径、训练轮数、显卡ID、图片大小等,然后执行训练即可
训练完成后,训练日志会在 runs/train
文件夹下,比如训练中 val 预测图片如下:
这样就完成了算法训练
使用 TensorRT 进行算法部署
直接执行一键导出ONNX脚本:
bash 3_run_export_onnx.sh
在脚本中已经对ONNX做了sim的简化
生成的ONNX以及_simONNX模型保存在wgts
文件夹下
直接去NVIDIA的官网下载(https://developer.nvidia.com/tensorrt/download)对应版本的tensorrt TAR包,解压基本步骤如下:
tar zxvf TensorRT-xxx-.tar.gz
# 软链trtexec
sudo ln -s /path/to/TensorRT/bin/trtexec /usr/local/bin
# 验证一下
trtexec --help
# 安装trt的python接口
cd python
pip install tensorrt-xxx.whl
直接执行一键生成trt模型引擎的脚本:
bash 4_build_trt_engine.sh
正常会在wgts
路径下生成yolo11n.engine,并有类似如下的日志:
[10/02/2024-21:28:48] [V] === Explanations of the performance metrics ===
[10/02/2024-21:28:48] [V] Total Host Walltime: the host walltime from when the first query (after warmups) is enqueued to when the last query is completed.
[10/02/2024-21:28:48] [V] GPU Compute Time: the GPU latency to execute the kernels for a query.
[10/02/2024-21:28:48] [V] Total GPU Compute Time: the summation of the GPU Compute Time of all the queries. If this is significantly shorter than Total Host Walltime, the GPU may be under-utilized because of host-side overheads or data transfers.
[10/02/2024-21:28:48] [V] Throughput: the observed throughput computed by dividing the number of queries by the Total Host Walltime. If this is significantly lower than the reciprocal of GPU Compute Time, the GPU may be under-utilized because of host-side overheads or data transfers.
[10/02/2024-21:28:48] [V] Enqueue Time: the host latency to enqueue a query. If this is longer than GPU Compute Time, the GPU may be under-utilized.
[10/02/2024-21:28:48] [V] H2D Latency: the latency for host-to-device data transfers for input tensors of a single query.
[10/02/2024-21:28:48] [V] D2H Latency: the latency for device-to-host data transfers for output tensors of a single query.
[10/02/2024-21:28:48] [V] Latency: the summation of H2D Latency, GPU Compute Time, and D2H Latency. This is the latency to infer a single query.
[10/02/2024-21:28:48] [I]
&&&& PASSED TensorRT.trtexec [TensorRT v100500] [b18] # trtexec --onnx=../wgts/yolo11n_sim.onnx --saveEngine=../wgts/yolo11n.engine --fp16 --verbose
直接执行一键推理脚本:
bash 5_infer_trt.sh
实际的trt推理脚本在 deploy/infer_trt.py
推理成功会有如下日志:
------ trt infer success! ------
推理结果保存在 deploy/output.jpg
如下:
好文章,需要你的鼓励
这项研究提出了ORV(占用中心机器人视频生成)框架,利用4D语义占用作为中间表示来生成高质量的机器人操作视频。与传统方法相比,ORV能提供更精确的语义和几何指导,实现更高的时间一致性和控制精度。该框架还支持多视角视频生成(ORV-MV)和模拟到真实的转换(ORV-S2R),有效弥合了虚拟与现实之间的差距。实验结果表明,ORV在多个数据集上的表现始终优于现有方法,为机器人学习和模拟提供了强大工具。
这项研究由Writer公司团队开发的"反思、重试、奖励"机制,通过强化学习教导大型语言模型生成更有效的自我反思内容。当模型回答错误时,它会生成反思并二次尝试,若成功则奖励反思过程。实验表明,该方法在函数调用和数学方程解题上带来显著提升,最高分别改善18.1%和34.7%。令人惊讶的是,经训练的小模型甚至超越了同家族10倍大的模型,且几乎不存在灾难性遗忘问题。这种自我改进技术为资源受限环境下的AI应用开辟了新方向。
FuseLIP是一项突破性研究,提出了通过早期融合离散标记实现多模态嵌入的新方法。与传统CLIP模型使用独立编码器不同,FuseLIP采用单一编码器同时处理图像和文本标记,实现了更自然的模态交互。研究证明,这种早期融合方法在多种多模态任务上表现优异,特别是在需要理解图像结构而非仅语义内容的任务上。研究还开发了创新的数据集和评估任务,为多模态嵌入研究提供了宝贵资源。
ByteDance与浙江大学合作开发的MERIT是首个专为多语言多条件语义检索设计的基准数据集,包含320,000条跨5种语言的查询和135,000个产品。研究发现现有模型在处理多条件查询时过度关注全局语义而忽略特定条件元素,为此提出CORAL框架,通过嵌入重建和对比学习相结合的方式,使检索性能提升45.9%。这项研究不仅识别了现有方法的关键局限性,还为多条件交错语义检索领域的未来研究奠定了基础。