乌兰察布市网站建设_网站建设公司_AJAX_seo优化
2026/1/13 20:58:23 网站建设 项目流程

博主介绍:✌全网粉丝10W+,前互联网大厂软件研发、集结硕博英豪成立工作室。专注于计算机相关专业项目实战6年之久,选择我们就是选择放心、选择安心毕业✌
> 🍅想要获取完整文章或者源码,或者代做,拉到文章底部即可与我联系了。🍅

点击查看作者主页,了解更多项目!

🍅感兴趣的可以先收藏起来,点赞、关注不迷路,大家在毕设选题,项目以及论文编写等相关问题都可以给我留言咨询,希望帮助同学们顺利毕业 。🍅

1、毕业设计:2025年计算机专业毕业设计选题汇总(建议收藏)✅

2、最全计算机专业毕业设计选题大全(建议收藏)✅

1、项目介绍

技术栈:
Python语言、Django框架、vue框架、torch、卷积神经网络CNN算法、HTML

一、图片修复步骤:
这些步骤用于实现整体修复、人脸检测、人脸增强、图像融合等功能。
Stage 1: Overall restoration(整体修复):
在这个阶段,系统会对整张老照片进行修复,包括修复损坏的区域、去除噪声、恢复细节等。这一步骤旨在还原整张照片的整体质量。
Stage 2: Face Detection(人脸检测):
在这个阶段,系统会使用人脸检测算法来自动识别照片中的人脸位置。通过准确地检测人脸,可以为后续的人脸增强和图像融合提供准确的区域。
Stage 3: Face Enhancement(人脸增强):
在这个阶段,系统会对检测到的人脸区域进行进一步的修复和增强。这包括去除人脸上的瑕疵、修复损坏的部分、增强细节等,以使人脸在修复后更加清晰和自然。
Stage 4: Blending(图像融合):
在这个阶段,系统会将修复后的人脸区域与整体修复的图像进行融合,以保持整体修复的一致性和平滑过渡。
这一步骤旨在使修复后的人脸与周围环境相匹配,使整张照片看起来更加自然。

2、项目界面

(1)上传图片,点击照片修复,系统按照上面4个步骤处理,处理完成显示处理后的效果图

(2)上传图片,点击照片修复,系统按照上面4个步骤处理,处理完成显示处理后的效果图

(3)照片修复历史记录

(4)注册登录

3、项目说明

摘 要

从墙壁绘画到暗箱拍摄,从银版摄影到彩色照片,从胶片冲印到数码相机,照片的发展印证了社会的发展和进步。照片不仅是一段时期的缩影和佐证,更是人类情感的载体。尽管在这个信息技术飞速发展的时代,情感需求也仍然是不可忽视的一环。而照片修复的意义则在于,让斑驳失去光泽的老照片重现生机,让那些逝去的记忆重返心中。就现今而言,真正意义上能够进行照片修复的技术人员并不多,照片修复的市场往往也是供大于求。利用机器深度学习来实现照片的智能修复,不仅能够满足大部分人修复旧照片的情感需要,也能够帮助相关技术人员更好的进行图像处理,使照片修复工作化繁为简,变得更加高效。
照片修复系统是基于后端框架Django设计并开发的,所运用的开发软件为PyCharm,借助其默认轻型嵌入式数据库SQLite存储样本数据。前端页面以Vue框架为主,Node.js为辅。系统所使用的编程语言有Python、JavaScript、HTML。

关键词:照片修复;深度学习;智能;图像处理

4 系统实现

登陆模块的实现有三个核心逻辑:
1.客户端传出逻辑:从控制器中取得用户填写的用户名和密码—>把信息装到登陆协议—>把信息传送给Web服务器。
2.服务器逻辑:服务器从通信模块收到协议—>判断协议编号—>通过协议编号判断出登陆协议—>解析出协议的内容(用户名和密码)—>通过封装好的数据库管理器里面的方法根据用户名获取到密码—>判断数据库提取出来的密码和解析内容密码是否相等—>如果相等,返回账号和密码正确,否则返回账号和密码不匹配。
3.客户端回传逻辑:客户端收到请求回调数据—>解析回调的数据类,如果收到“账号密码正确”,则可以跳转到下一个场景。如果收到”账号密码不匹配”,把消息通过控制器放入提示框。显示在登陆界面。
照片修复系统的登录页面,灵感来源于 qq登陆时的界面。设计以简洁为主,因此页面背景选择了网页原有的底色,未添加任何相关背景的渲染。具体页面如图4.1所示。

登录框位于整个背景的中心区域,看起来更加舒服。加上两个输入框,搭配深蓝色登录按钮,简洁大方。浅灰色“还没账号?立即注册”按钮,是一个超链接,可跳转至注册页面。这就是登录页面的全部内容,输入好用户名和密码,点击登录按钮就可以进入到系统主界面啦。

在登录页面,点击左下角的“还没账号?立即注册”按钮,将立即跳转至注册页面。这个页面包含三个输入框,分别是:输入用户名,输入密码和再次输入密码。系统利用名的唯一性,作为区分用区分用户的标准,因此输入的用户名必须是唯一且非空的[13]。这里的用户名和密码长度并无过多限制,基本满足用户注册的需求。其注册的逻辑与登陆逻辑类似,这里就不做赘述了。页面样式如下图4.2所示。

主界面的配色选择了紫色,左侧放置是功能栏,中间是一张在进行系统测试时所选用过的旧照片,照片的上面和下面分别是一些文字性的描述和一个上传图片的按钮,页面的右上角是个人的登陆状态。如图4.3所示。

这个页面在简约的基础上,加了一点小小的设计,当鼠标划至页面中间的旧照片上时,这张照片会变成其修复后的样子,增强了系统的可观性。这部分用到的是前端技术中的鼠标悬停,鼠标悬停的意思是指,当鼠标在网页的部分图标、文字或者图片上停留的时候,会有部分内容弹出或改变,当从这个图标、文字或者图片上移开鼠标后,弹出的内容自动缩回或改变的内容变回原样[12]。如图4.4所示。

历史记录模块是对当前登陆用户所有的修复记录的一个展现,为用户提供对以往修复照片的保存机会。如图4.5所示。

这个模块主要是对于数据库中照片记录表(photo)的使用,将封存在数据库表中的数据与照片路径进行调用,经过交互,在页面中显示出来,实现并不复杂。

4、核心代码

# Copyright (c) Microsoft Corporation.# Licensed under the MIT License.importosimportargparseimportshutilimportsysfromsubprocessimportcalldefrun_cmd(command):try:call(command,shell=True)exceptKeyboardInterrupt:print("Process interrupted")sys.exit(1)if__name__=="__main__":parser=argparse.ArgumentParser()parser.add_argument("--input_folder",type=str,default="./test_images/old",help="Test images")parser.add_argument("--output_folder",type=str,default="./output",help="Restored images, please use the absolute path",)parser.add_argument("--GPU",type=str,default="6,7",help="0,1,2")parser.add_argument("--checkpoint_name",type=str,default="Setting_9_epoch_100",help="choose which checkpoint")parser.add_argument("--with_scratch",action="store_true")parser.add_argument("--HR",action='store_true')opts=parser.parse_args()gpu1=opts.GPU# resolve relative paths before changing directoryopts.input_folder=os.path.abspath(opts.input_folder)opts.output_folder=os.path.abspath(opts.output_folder)ifnotos.path.exists(opts.output_folder):os.makedirs(opts.output_folder)main_environment=os.getcwd()## Stage 1: Overall Quality Improveprint("Running Stage 1: Overall restoration")os.chdir("./Global")stage_1_input_dir=opts.input_folder stage_1_output_dir=os.path.join(opts.output_folder,"stage_1_restore_output")ifnotos.path.exists(stage_1_output_dir):os.makedirs(stage_1_output_dir)ifnotopts.with_scratch:stage_1_command=("python test.py --test_mode Full --Quality_restore --test_input "+stage_1_input_dir+" --outputs_dir "+stage_1_output_dir+" --gpu_ids "+gpu1)run_cmd(stage_1_command)else:mask_dir=os.path.join(stage_1_output_dir,"masks")new_input=os.path.join(mask_dir,"input")new_mask=os.path.join(mask_dir,"mask")stage_1_command_1=("python detection.py --test_path "+stage_1_input_dir+" --output_dir "+mask_dir+" --input_size full_size"+" --GPU "+gpu1)ifopts.HR:HR_suffix=" --HR"else:HR_suffix=""stage_1_command_2=("python test.py --Scratch_and_Quality_restore --test_input "+new_input+" --test_mask "+new_mask+" --outputs_dir "+stage_1_output_dir+" --gpu_ids "+gpu1+HR_suffix)run_cmd(stage_1_command_1)run_cmd(stage_1_command_2)## Solve the case when there is no face in the old photostage_1_results=os.path.join(stage_1_output_dir,"restored_image")stage_4_output_dir=os.path.join(opts.output_folder,"final_output")ifnotos.path.exists(stage_4_output_dir):os.makedirs(stage_4_output_dir)forxinos.listdir(stage_1_results):img_dir=os.path.join(stage_1_results,x)shutil.copy(img_dir,stage_4_output_dir)print("Finish Stage 1 ...")print("\n")## Stage 2: Face Detectionprint("Running Stage 2: Face Detection")os.chdir(".././Face_Detection")stage_2_input_dir=os.path.join(stage_1_output_dir,"restored_image")stage_2_output_dir=os.path.join(opts.output_folder,"stage_2_detection_output")ifnotos.path.exists(stage_2_output_dir):os.makedirs(stage_2_output_dir)ifopts.HR:stage_2_command=("python detect_all_dlib_HR.py --url "+stage_2_input_dir+" --save_url "+stage_2_output_dir)else:stage_2_command=("python detect_all_dlib.py --url "+stage_2_input_dir+" --save_url "+stage_2_output_dir)run_cmd(stage_2_command)print("Finish Stage 2 ...")print("\n")## Stage 3: Face Restoreprint("Running Stage 3: Face Enhancement")os.chdir(".././Face_Enhancement")stage_3_input_mask="./"stage_3_input_face=stage_2_output_dir stage_3_output_dir=os.path.join(opts.output_folder,"stage_3_face_output")ifnotos.path.exists(stage_3_output_dir):os.makedirs(stage_3_output_dir)ifopts.HR:opts.checkpoint_name='FaceSR_512'stage_3_command=("python test_face.py --old_face_folder "+stage_3_input_face+" --old_face_label_folder "+stage_3_input_mask+" --tensorboard_log --name "+opts.checkpoint_name+" --gpu_ids "+gpu1+" --load_size 512 --label_nc 18 --no_instance --preprocess_mode resize --batchSize 1 --results_dir "+stage_3_output_dir+" --no_parsing_map")else:stage_3_command=("python test_face.py --old_face_folder "+stage_3_input_face+" --old_face_label_folder "+stage_3_input_mask+" --tensorboard_log --name "+opts.checkpoint_name+" --gpu_ids "+gpu1+" --load_size 256 --label_nc 18 --no_instance --preprocess_mode resize --batchSize 4 --results_dir "+stage_3_output_dir+" --no_parsing_map")run_cmd(stage_3_command)print("Finish Stage 3 ...")print("\n")## Stage 4: Warp backprint("Running Stage 4: Blending")os.chdir(".././Face_Detection")stage_4_input_image_dir=os.path.join(stage_1_output_dir,"restored_image")stage_4_input_face_dir=os.path.join(stage_3_output_dir,"each_img")stage_4_output_dir=os.path.join(opts.output_folder,"final_output")ifnotos.path.exists(stage_4_output_dir):os.makedirs(stage_4_output_dir)ifopts.HR:stage_4_command=("python align_warp_back_multiple_dlib_HR.py --origin_url "+stage_4_input_image_dir+" --replace_url "+stage_4_input_face_dir+" --save_url "+stage_4_output_dir)else:stage_4_command=("python align_warp_back_multiple_dlib.py --origin_url "+stage_4_input_image_dir+" --replace_url "+stage_4_input_face_dir+" --save_url "+stage_4_output_dir)run_cmd(stage_4_command)print("Finish Stage 4 ...")print("\n")print("All the processing is done. Please check the results.")

5、项目获取

(绿色聊天软件)yuanmazhiwu 或 biyesheji0005

🍅由于篇幅限制,获取完整文章或源码、代做项目的,查看我的【用户名】、【专栏名称】、【顶部选题链接】就可以找到我啦🍅

感兴趣的可以先收藏起来,点赞、关注不迷路,下方查看👇🏻获取联系方式👇🏻

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询