使用GAN检测野外微小人脸:Bai_Finding_Tiny_Faces 技术解析

需积分: 16 4 下载量 171 浏览量 更新于2024-09-09 收藏 2.19MB PDF 举报
"Bai_Finding_Tiny_Faces_CVPR_2018_paper" 这篇论文"Finding Tiny Faces in the Wild with Generative Adversarial Networks"由Yancheng Bai等人在CVPR 2018上发表,主要关注的是在自然场景中检测微小人脸的挑战。CVPR(Computer Vision and Pattern Recognition)是计算机视觉领域的顶级会议,因此这篇论文代表了该领域最新的研究成果。 微小人脸检测是计算机视觉中的一个长期难题,因为这些小尺寸的人脸往往缺乏清晰的细节,容易模糊,这给传统的检测算法带来了困难。论文提出了一种基于生成对抗网络(Generative Adversarial Networks, GANs)的新算法,旨在直接生成清晰、高分辨率的人脸图像,从而提高检测的准确性。 作者们设计了一个包含超分辨率(Super-Resolution)和精炼网络(Refinement Network)的框架。首先,他们使用超分辨率网络将低分辨率模糊的人脸图像放大到四倍其原始大小,恢复部分丢失的细节。然后,精炼网络进一步优化生成的图像,使得面部特征更加清晰,更易于检测。如图1所示,对比直接使用双线性内核放大(b)和传统超分辨率方法(c),他们的算法(d)能够得到更精确的结果。 在实际应用中,这种技术对于人脸识别、监控视频分析以及增强现实等领域具有重要意义。通过解决微小人脸的检测问题,可以提升系统的整体性能,尤其是在低光照、远距离或图像质量不佳的条件下。 论文的贡献主要包括: 1. 提出了一种结合超分辨率和精炼网络的深度学习架构,专门针对微小人脸的检测。 2. 使用生成对抗网络来恢复和增强小尺寸人脸的细节,提高了检测的准确性和鲁棒性。 3. 实验结果表明,这种方法在各种复杂环境中表现优于现有技术,展示了其在实际应用中的潜力。 总体来说,这篇论文为解决计算机视觉领域的小尺度人脸检测问题提供了一个创新且有效的解决方案,对于推动相关技术的发展具有重要的理论价值和实践意义。

* This example shows how to use shape-based matching * in order to find a model region and use it for * further tasks. * Here, the additional task consists of reading text * within a certain region, wherefore the image has * to be aliged using the matching transformation. * * Initialization. dev_update_window ('off') dev_close_window () * Initialize visualization. read_image (ReferenceImage, 'board/board_01') get_image_size (ReferenceImage, Width, Height) initialize_visualization (Width / 2, Height / 2, WindowHandle, WindowHandleText) disp_continue_message (WindowHandle, 'black', 'true') disp_description_text (WindowHandleText) * * Define ROIs: * ROI for the shape model. dev_set_window (WindowHandle) dev_display (ReferenceImage) gen_rectangle1 (ROIModel, 60, 535, 185, 900) dev_display (ROIModel) * ROI for the text. gen_rectangle1 (ROIText, 445, 585, 590, 765) dev_display (ROIText) disp_model_message (WindowHandle) stop () * * Prepare the shape-based matching model. reduce_domain (ReferenceImage, ROIModel, ModelImage) * Create shape model and set parameters (offline step). create_generic_shape_model (ModelHandle) * Train the shape model. train_generic_shape_model (ModelImage, ModelHandle) * * Prepare the text model. create_text_model_reader ('auto', 'Industrial_0-9A-Z_Rej.omc', TextModel) * * We look for the reference transformation which we will need * for the alignment. We can extract it by finding the instance * on the reference image. * Set find parameters. set_generic_shape_model_param (ModelHandle, 'num_matches', 1) set_generic_shape_model_param (ModelHandle, 'min_score', 0.5) find_generic_shape_model (ReferenceImage, ModelHandle, MatchResultID, Matches) get_generic_shape_model_result (MatchResultID, 'all', 'hom_mat_2d', HomMat2DModel) * * Find the object in other images (online step). for i := 1 to 9 by 1 read_image (SearchImage, 'board/board_' + i$'02') find_generic_shape_model (SearchImage, ModelHandle, MatchResultID, Matches) get_generic_shape_model_result (MatchResultID, 'all', 'hom_mat_2d', HomMat2DMatch) * Compute the transformation matrix. hom_mat2d_invert (HomMat2DMatch, HomMat2DMatchInvert) hom_mat2d_compose (HomMat2DModel, HomMat2DMatchInvert, TransformationMatrix) affine_trans_image (SearchImage, ImageAffineTrans, TransformationMatrix, 'constant', 'false') * * Visualization. dev_set_window (WindowHandle) dev_display (SearchImage) get_generic_shape_model_result_object (InstanceObject, MatchResultID, 'all', 'contours') dev_display (InstanceObject) * * Reading text and numbers on the aligned image. reduce_domain (ImageAffineTrans, ROIText, ImageOCR) find_text (ImageOCR, TextModel, TextResultID) get_text_object (Characters, TextResultID, 'all_lines') get_text_result (TextResultID, 'class', RecognizedText) * * Visualization. dev_set_window (WindowHandleText) dev_display (ImageAffineTrans) dev_set_colored (12) dev_display (Characters) disp_finding_text (Characters, WindowHandle, WindowHandleText, RecognizedText) wait_seconds (0.5) endfor disp_end_of_program_message (WindowHandle, 'black', 'true') stop () dev_close_window ()

248 浏览量

优化finding函数,#include<algorithm> #include<iostream> #include<vector> #include<string> #include<cmath> #include <cstdio> #include <map> #include <unordered_map> #include <queue> using namespace std; const int INF = 0x3f3f3f3f; int n, gamma, time_count=0; int time[10]; string alpha; vector<int> Length(50005, 0); unordered_map<string, int> number; unordered_map<int, string> nega_number; vector<unordered_map<int, int>> edge(50005); vector<int> trace(50005, 0); vector<int> final_trace; void finding(string alpha) { int a=number[alpha], b; char beta; string epsilon; for(int i=9; i>=0; i--) { for(int j=1; j<10; j++) { epsilon = alpha; epsilon[i] = '0' + (int(epsilon[i]) + j) % 10; if(number.find(epsilon) != number.end() and epsilon != alpha) { b = number[epsilon]; edge[a][b]= time[i]; } } for(int j=i-1; j>=0; j--) { epsilon = alpha; beta = epsilon[j]; epsilon[j] = epsilon[i]; epsilon[i] = beta; if(number.find(epsilon) != number.end() and epsilon != alpha) { b = number[epsilon]; edge[a][b]= time[j]; } } } } void dijkstra(int i) { priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> q; vector<bool> vis(n+1, false); q.push({0, i}); Length[i] = 0; while(!q.empty()) { int u = q.top().second; q.pop(); if(vis[u]) continue; vis[u] = true; for(auto j : edge[u]) { int v = j.first, w = j.second; if(Length[v] > Length[u] + w) { Length[v] = Length[u] + w; trace[v] = u; q.push({Length[v], v}); } } } } int main() { cin>>n; for(int i=2; i<n+1;i++) { Length[i] = INF; } for(int i=0; i<10; i++) { cin>>time[i]; } for(int i=0; i<n; i++) { cin>>alpha; nega_number[i] = alpha; number[alpha] = i+1; } for(int i=0; i<n; i++) { alpha = nega_number[i]; finding(alpha); } dijkstra(1); if(Length[n] == INF) { cout<<"-1"; } else { gamma = n; final_trace.push_back(gamma); cout<<Length[n]<<endl; while(gamma != 1) { gamma = trace[gamma]; final_trace.push_back(gamma); } cout<<final_trace.size()<<endl; for(int i=final_trace.size()-1;i>-1;i--) { cout<<final_trace[i]<<" "; } } system("pause"); return 0; }

2023-05-28 上传
少撸游戏多撸代码
  • 粉丝: 0
  • 资源: 1
上传资源 快速赚钱