⚡️An Easy-to-use and Fast Deep Learning Model Deployment Toolkit for ☁️Cloud 📱Mobile and 📹Edge. Including Image, Video, Text and Audio 20+ main stream scenarios and 150+ SOTA models with end-to-end optimization, multi-platform and multi-framework support.
for (const auto& file_path : batch_files) {
auto image = cv::imread(file_path);
if (image.empty()) {
std::cerr << "Failed to load image: " << file_path << std::endl;
continue; // Skip this image and continue with the next
}
batch_images.push_back(image);
if (batch_images.size() == cfg.bs)
ProcessBatchImage(batch_images, &batch_results);
}
// 处理剩余的图片(如果有)
if (!batch_images.empty())
ProcessBatchImage(batch_images, &batch_results);
温馨提示:根据社区不完全统计,按照模板提问,可以加快回复和解决问题的速度
环境
问题日志及出现问题的操作流程
void Model::InferImagesBatch(const std::vector& batch_files){
std::vector batch_images;
std::vector batch_names;
std::vector batch_results;
batch_images.reserve(cfg.bs);
}