[python] 利用opencv显示对比试验效果

利用 opencv 显示 对比实验效果 选择有效区域

import os
import random
import uuidfrom tqdm import tqdm
import cv2
import numpy as np
import matplotlib.pyplot as plt
GT_Dir="results_compare/GT/"
Bicubic_dir="results_compare/Bicubic4x/"
Phase_dir ="results_compare/JiLin-1_ori_resSr/"
LR_Dir="results_compare/LR4x/"
MSDTGP_Dir="results_compare/MSDTGP/"
SAVE_Dir="results_compare/Save_Dir/"
# MSDTGP_Dir="/home/lenovo/Documents/code/PhaseVSRnet/visual_cmp/exp_compare/MSDTGP/"                                   #生成的EDVR效果图CACHE_DATA = True
cache_data={}#获取文件目录结构
def getFileDict():#获取全部场景scenes=os.listdir(GT_Dir)scene_files={}for scene in scenes:dir_scene=os.path.join(GT_Dir,scene)fileNames=os.listdir(dir_scene)scene_files[scene]=list(fileNames)return scene_files#获取残差路径
def save_residual_img(dir,scene,file,mode="type"):ori_file = os.path.join(dir, scene, file)if "_residual" in scene:return 0if not os.path.exists(ori_file):return 0if mode=="phase":index = int(file.split(".")[0])+1ori_file = os.path.join(dir, scene, "rgb_sr_%02d.png" % index)residual_dir = os.path.abspath(os.path.join(dir,scene+"_residual",file))os.makedirs(os.path.join(dir,scene+"_residual"),exist_ok=True)gt_file = os.path.join(GT_Dir,scene,file)if ori_file in cache_data:ori_img = cache_data.get(ori_file)else:ori_img = cv2.imread(ori_file, cv2.IMREAD_GRAYSCALE)  # 以灰度图形式读入cache_data[ori_file] = ori_imgif gt_file in cache_data:gt_img = cache_data.get(gt_file)else:gt_img = cv2.imread(gt_file, cv2.IMREAD_GRAYSCALE)  # 以灰度图形式读入cache_data[gt_file] = gt_imgif ori_img is None:ccc=0if gt_img is None:ccc=0res_img = ori_img-gt_img# cv2.imshow("aa",res_img)# cv2.waitKey(0)# plt.imshow(res_img,cmap='gray')# plt.show()cv2.imwrite(residual_dir,res_img)# plt.savefig(residual_dir)return residual_dir,gt_file#生成残差效果图
def product_residual(scene_dict):for scene,files in scene_dict.items():#生成Bicubic的残差结果for file_name in tqdm(files):#保存bicubic残差结果save_residual_img(Bicubic_dir,scene,file_name,"bic")save_residual_img(GT_Dir,scene,file_name,"GT")save_residual_img(Phase_dir,scene,file_name,"phase")# save_residual_img(LR_Dir,scene,file_name,"LR")save_residual_img(MSDTGP_Dir,scene,file_name,"MSDTGP")# save_residual_img(MSDTGP_Dir, scene, file_name)#画矩形框
def drawBox(img,bbox):img_c=img.copy()cv2.rectangle(img_c,(bbox[0],bbox[1]),(bbox[2],bbox[3]),(0,255,0),2)return img_c
def drwaPicture(img_src,img_target,bbox):plt.imshow(img_src)plt.show()plt.imshow(img_target)plt.show()img_c=img_src.copy()# img_c[bbox[0]:bbox[2],bbox[1]:bbox[3],:]=img_target[:,:,:]img_c[bbox[0]:bbox[2],bbox[1]:bbox[3]]=img_targetplt.imshow(img_c)plt.show()# cv2.rectangle(img_c,(bbox[0],bbox[1]),(bbox[2],bbox[3]),(0,255,0),1.0)return img_c#刷新窗口
def refreshWindow(LR_img,phase_img,bic_img,gt_img,msdtgp_img,bbox,x=0,y=0,window_name="aa"):w,h=gt_img.shape[:2]#更新窗口显示信息#LR_img# plt.imshow(gt_img)# plt.show()PhaseImage_box=drawBox(phase_img,bbox)BicubicImage_box=drawBox(bic_img,bbox)GTImage_box=drawBox(gt_img,bbox)MSDTGPImage_box=drawBox(msdtgp_img,bbox)GT_imgc=drawBox(gt_img,bbox)    #画完框的LRGT_imgc_or=GT_imgc.copy()# cv2.circle(GT_imgc,(x,y),3,(0,0,255),1)# plt.imshow(GT_imgc)# plt.show()#取框中信息# plt.imshow(phase_img)# plt.show()phase_imgc = phase_img[bbox[1]:bbox[3],bbox[0]:bbox[2],:]# plt.imshow(phase_imgc)# plt.show()bic_imgc = bic_img[bbox[1]:bbox[3],bbox[0]:bbox[2],:]gt_imgc = gt_img[bbox[1]:bbox[3],bbox[0]:bbox[2],:]msdtgp_imgc = msdtgp_img[bbox[1]:bbox[3],bbox[0]:bbox[2],:]# plt.imshow(phase_imgc)# plt.show()LR_imgcu = np.zeros_like(LR_img)phase_imgcu = np.zeros_like(LR_img)bic_imgcu = np.zeros_like(LR_img)gt_imgcu = np.zeros_like(LR_img)msdtgp_imgcu = np.zeros_like(LR_img)phase_imgcu = cv2.resize(phase_imgc,(int(gt_img.shape[0] // 2), int(gt_img.shape[1] // 2)),phase_imgcu)bic_imgcu = cv2.resize(bic_imgc,(int(gt_img.shape[0] // 2), int(gt_img.shape[1] // 2)),bic_imgcu)gt_imgcu = cv2.resize(gt_imgc,(int(gt_img.shape[0] // 2), int(gt_img.shape[1] // 2)),gt_imgcu)msdtgp_imgcu = cv2.resize(msdtgp_imgc,(int(gt_img.shape[0] // 2), int(gt_img.shape[1] // 2)),msdtgp_imgcu)# phase_imgcu = cv2.resize(phase_imgc,(int(gt_img.shape[0] // 2), int(gt_img.shape[1] // 2)),phase_imgcu)# plt.imshow(phase_imgcu)# plt.show()# cv2.pyrUp(phase_imgc,phase_imgcu,(int(gt_img.shape[0] // 2), int(gt_img.shape[1] // 2)))# cv2.pyrUp(bic_imgc,bic_imgcu,(int(gt_img.shape[0] // 2), int(gt_img.shape[1] // 2)))# cv2.pyrUp(gt_imgc,gt_imgcu,(int(gt_img.shape[0] // 2), int(gt_img.shape[1] // 2)))# cv2.pyrUp(msdtgp_imgc,msdtgp_imgcu,(int(gt_img.shape[0] // 2), int(gt_img.shape[1] // 2)))#h w c# img_back=np.ones((gt_img.shape[0],gt_img.shape[1]*3,3)) * 255.0## img_show=drwaPicture(img_back,GT_imgc,[0,0,w,h])#求灰度值phase_imgcu_gray=cv2.cvtColor(phase_imgcu,cv2.COLOR_RGB2GRAY)bic_imgcu_gray=cv2.cvtColor(bic_imgcu,cv2.COLOR_RGB2GRAY)gt_imgcu_gray=cv2.cvtColor(gt_imgcu,cv2.COLOR_RGB2GRAY)msdtgp_imgcu_gray=cv2.cvtColor(msdtgp_imgcu,cv2.COLOR_RGB2GRAY)# phase_imgcu_gray=cv2.cvtColor(phase_imgcu,cv2.COLOR_RGB2GRAY)#求差值phase_imgcu_residual = phase_imgcu_gray - gt_imgcu_graybic_imgcu_residual = bic_imgcu_gray - gt_imgcu_graygt_imgcu_residual = gt_imgcu_gray - gt_imgcu_graymsdtgp_imgcu_residual = msdtgp_imgcu_gray - gt_imgcu_graymin_phase,max_phase=np.min(phase_imgcu_residual),np.max(phase_imgcu_residual)#范围是【125,255】# phase_imgcu_residual = 125.0 + (phase_imgcu_residual- min_phase )*((255.0-125.0)/(max_phase-min_phase))phase_imgcu_residual = 0.0 + (phase_imgcu_residual- min_phase )*((255.0-0.0)/(max_phase-min_phase))#其他的min_phase,max_phase=np.min(bic_imgcu_residual),np.max(bic_imgcu_residual)#范围是【125,255】# phase_imgcu_residual = 125.0 + (phase_imgcu_residual- min_phase )*((255.0-125.0)/(max_phase-min_phase))bic_imgcu_residual = 0.0 + (bic_imgcu_residual- min_phase )*((255.0-0.0)/(max_phase-min_phase))# min_phase,max_phase=np.min(gt_imgcu_residual),np.max(gt_imgcu_residual)#范围是【125,255】# phase_imgcu_residual = 125.0 + (phase_imgcu_residual- min_phase )*((255.0-125.0)/(max_phase-min_phase))# gt_imgcu_residual = 0.0 + (gt_imgcu_residual- min_phase )*((255.0-0.0)/(max_phase-min_phase))min_phase,max_phase=np.min(msdtgp_imgcu_residual),np.max(msdtgp_imgcu_residual)#范围是【125,255】# phase_imgcu_residual = 125.0 + (phase_imgcu_residual- min_phase )*((255.0-125.0)/(max_phase-min_phase))msdtgp_imgcu_residual = 0.0 + (msdtgp_imgcu_residual- min_phase )*((255.0-0.0)/(max_phase-min_phase))# # phase_imgcu_residual = ((phase_imgcu_gray - gt_imgcu_gray)/255)*130+125# bic_imgcu_residual = (np.abs(bic_imgcu_gray - gt_imgcu_gray)/255)*125+130# # gt_imgcu_residual = (np.abs(gt_imgcu_gray - gt_imgcu_gray)/255)*105+150# msdtgp_imgcu_residual = (np.abs(msdtgp_imgcu_gray - gt_imgcu_gray)/255)*120+135## gt_imgcu_residual = (np.abs(gt_imgcu_gray - gt_imgcu_gray)/255)*105 +125# phase_imgcu_residual = np.abs(phase_imgcu_gray - gt_imgcu_gray)# 灰度图转伪彩色# COLORMAP_AUTUMN、COLORMAP_BONE、COLORMAP_JET、COLORMAP_WINTER、COLORMAP_RAINBOW、COLORMAP_OCEAN、COLORMAP_SUMMER: int# COLORMAP_SPRING、COLORMAP_COOL、COLORMAP_HSV、COLORMAP_PINK、COLORMAP_HOT、COLORMAP_PARULA、COLORMAP_MAGMA、COLORMAP_INFERNO: int# COLORMAP_PLASMA、COLORMAP_VIRIDIS、COLORMAP_CIVIDIS、COLORMAP_TWILIGHT、COLORMAP_TWILIGHT_SHIFTED、COLORMAP_TURBO、# COLORMAP_DEEPGREEN、ColormapTypes = intphase_imgcu_residual_show = cv2.applyColorMap(phase_imgcu_residual.astype(np.uint8), cv2.COLORMAP_JET)# phase_imgcu_residual_show = cv2.cvtColor( phase_imgcu_residual_show, cv2.COLOR_BGR2RGB)bic_imgcu_residual_show = cv2.applyColorMap(bic_imgcu_residual.astype(np.uint8), cv2.COLORMAP_JET)# bic_imgcu_residual_show = cv2.cvtColor( bic_imgcu_residual_show, cv2.COLOR_BGR2RGB)gt_imgcu_residual_show = cv2.applyColorMap(gt_imgcu_residual.astype(np.uint8), cv2.COLORMAP_JET)# gt_imgcu_residual_show = cv2.cvtColor( gt_imgcu_residual_show, cv2.COLOR_BGR2RGB)msdtgp_imgcu_residual_show = cv2.applyColorMap(msdtgp_imgcu_residual.astype(np.uint8), cv2.COLORMAP_JET)# msdtgp_imgcu_residual_show = cv2.cvtColor( msdtgp_imgcu_residual_show, cv2.COLOR_BGR2RGB)# phase_imgcu_residual_show = np.array([phase_imgcu_residual for i in range(3)]).transpose(2,1,0)# bic_imgcu_residual_show = np.array([bic_imgcu_residual for i in range(3)]).transpose(2,1,0)# gt_imgcu_residual_show = np.array([gt_imgcu_residual for i in range(3)]).transpose(2,1,0)# msdtgp_imgcu_residual_show = np.array([msdtgp_imgcu_residual for i in range(3)]).transpose(2,1,0)# # phase_imgcu_residual_show = np.array([phase_imgcu_residual for i in range(3)]).transpose(1,2,0)# bic_imgcu_residual = np.abs(bic_imgcu_gray - gt_imgcu_gray)# gt_imgcu_residual = np.abs(gt_imgcu_gray - gt_imgcu_gray)# msdtgp_imgcu_residual = np.abs(msdtgp_imgcu_gray - gt_imgcu_gray)#画图# phase_imgcu_residual_show = cv2.addWeighted(phase_imgcu, 1.0, phase_imgcu, 0.3, 0.3)# cv2.imwrite(os.path.join(SAVE_Dir,"imgcu.png"),phase_imgcu)# cv2.imwrite(os.path.join(SAVE_Dir,"imgres.png"),phase_imgcu_residual_show)phase_imgcu_residual_show_noadd = phase_imgcu_residual_show.copy()bic_imgcu_residual_show_noadd = bic_imgcu_residual_show.copy()gt_imgcu_residual_show_noadd = gt_imgcu_residual_show.copy()msdtgp_imgcu_residual_show_noadd = msdtgp_imgcu_residual_show.copy()phase_imgcu_residual_show = 0.1 * phase_imgcu_residual_show + phase_imgcu# cv2.imwrite(os.path.join(SAVE_Dir,"fusion.png"),phase_imgcu_residual_show)bic_imgcu_residual_show = 0.1 * bic_imgcu_residual_show + bic_imgcu# gt_imgcu_residual_show = 0.15 * gt_imgcu_residual_show + gt_imgcugt_imgcu_residual_show = gt_imgcumsdtgp_imgcu_residual_show = 0.1 * msdtgp_imgcu_residual_show + msdtgp_imgcuimg2=np.concatenate([phase_imgcu,phase_imgcu_residual_show.astype(np.uint8)],axis=0)img3=np.concatenate([bic_imgcu,bic_imgcu_residual_show.astype(np.uint8)],axis=0)img4=np.concatenate([gt_imgcu,gt_imgcu_residual_show.astype(np.uint8)],axis=0)img5=np.concatenate([msdtgp_imgcu,msdtgp_imgcu_residual_show.astype(np.uint8)],axis=0)# img5=np.concatenate([phase_imgcu,msdtgp_imgcu_residual],axis=0)img_show= np.concatenate([GT_imgc_or,img4,img3,img5,img2],axis=1)cv2.imwrite(os.path.join(SAVE_Dir,"fusion_all.png"),img_show)cv2.imshow(window_name,img_show)while(True):if cv2.waitKey(1) & 0xFF == ord('p'):  # 摁下q退出breakif cv2.waitKey(1) & 0xFF == ord('s'):savePics(img_show,phase_imgcu_residual_show_noadd,bic_imgcu_residual_show_noadd, gt_imgcu_residual_show_noadd,msdtgp_imgcu_residual_show_noadd,PhaseImage_box,BicubicImage_box,GTImage_box,MSDTGPImage_box,LR_img,GT_imgc_or,GT_imgc,phase_imgcu,bic_imgcu,gt_imgcu,msdtgp_imgcu,phase_imgcu_residual_show,bic_imgcu_residual_show,gt_imgcu_residual_show,msdtgp_imgcu_residual_show)cv2.destroyAllWindows()# plt.imshow(img_show)# plt.show()# ccc=0# PhaseImage_box=drawBox(phase_img)# BicubicImage_box=drawBox(bic_img)# GTImage_box=drawBox(gt_img)# MSDTGPImage_box=drawBox(msdtgp_img)
def savePics( img_show,phase_imgcu_residual_show_noadd,bic_imgcu_residual_show_noadd, gt_imgcu_residual_show_noadd,msdtgp_imgcu_residual_show_noadd,PhaseImage_box,BicubicImage_box,GTImage_box,MSDTGPImage_box,LR_img,GT_imgc_or,GT_imgc,phase_imgcu,bic_imgcu,gt_imgcu,msdtgp_imgcu,phase_imgcu_residual_show,bic_imgcu_residual_show,gt_imgcu_residual_show,msdtgp_imgcu_residual_show):save_dir=os.path.join(SAVE_Dir,str(uuid.uuid4())[:8])if not os.path.exists(save_dir):os.makedirs(save_dir, exist_ok=True)cv2.imwrite(os.path.join(save_dir, "a_image_overview.png"), img_show)cv2.imwrite(os.path.join(save_dir, "phase_imgcu_residual_show_noadd.png"), phase_imgcu_residual_show_noadd)cv2.imwrite(os.path.join(save_dir, "bic_imgcu_residual_show_noadd.png"), bic_imgcu_residual_show_noadd)cv2.imwrite(os.path.join(save_dir, "gt_imgcu_residual_show_noadd.png"), gt_imgcu_residual_show_noadd)cv2.imwrite(os.path.join(save_dir, "msdtgp_imgcu_residual_show_noadd.png"), msdtgp_imgcu_residual_show_noadd)cv2.imwrite(os.path.join(save_dir,"Phase_imgbox_whole.png"),PhaseImage_box)cv2.imwrite(os.path.join(save_dir,"Bicubic_imgbox_whole.png"),BicubicImage_box)cv2.imwrite(os.path.join(save_dir,"GT_imgbox_whole.png"),GTImage_box)cv2.imwrite(os.path.join(save_dir,"MSDTGP_imgbox_whole.png"),MSDTGPImage_box)cv2.imwrite(os.path.join(save_dir,"LR_img.png"),LR_img)cv2.imwrite(os.path.join(save_dir,"GT_img_box.png"),GT_imgc_or)cv2.imwrite(os.path.join(save_dir,"GT_img_boxpt.png"),GT_imgc)cv2.imwrite(os.path.join(save_dir,"phasevsr_img_area.png"),phase_imgcu)cv2.imwrite(os.path.join(save_dir,"bicubic_img_area.png"),bic_imgcu)cv2.imwrite(os.path.join(save_dir,"GT_img_area.png"),gt_imgcu)cv2.imwrite(os.path.join(save_dir,"msdtgp_img_area.png"),msdtgp_imgcu)cv2.imwrite(os.path.join(save_dir,"phasevsr_img_resdiual.png"),phase_imgcu_residual_show)cv2.imwrite(os.path.join(save_dir,"bicubic_img_resdiual.png"),bic_imgcu_residual_show)cv2.imwrite(os.path.join(save_dir,"GT_img_resdiual.png"),gt_imgcu_residual_show)cv2.imwrite(os.path.join(save_dir,"msdtgp_img_resdiual.png"),msdtgp_imgcu_residual_show)print(f"save picture at: {save_dir}")pass# 回调函数
def MouseEvent(event, x, y, flags, param):# print('[{},{}]'.format(x, y))  # 坐标,原点在左上角if flags == cv2.EVENT_FLAG_SHIFTKEY:print("shift 键按下")if event == cv2.EVENT_MOUSEMOVE:LR_img, phase_img, bic_img, gt_img, msdtgp_img, box_size, windowname= paramprint(f"move x:{x} y:{y} box_size={box_size}\n")bbox=[x-box_size,y-box_size,x+box_size,y+box_size]print(f"bbox:{bbox[0]},{bbox[1]},{bbox[2]},{bbox[3]}")refreshWindow(LR_img,phase_img,bic_img,gt_img,msdtgp_img,bbox,x,y,windowname)if event == cv2.EVENT_LBUTTONDBLCLK:print(f"左键双击")LR_img, phase_img, bic_img, gt_img, msdtgp_img, box_size, windowname = paramprint(f"move x:{x} y:{y} box_size={box_size}\n")bbox = [x - box_size, y - box_size, x + box_size, y + box_size]print(f"bbox:{bbox[0]},{bbox[1]},{bbox[2]},{bbox[3]}")refreshWindow(LR_img, phase_img, bic_img, gt_img, msdtgp_img, bbox, x, y, windowname)'''if flags == cv2.EVENT_FLAG_ALTKEY:print('摁住Alt')if flags == cv2.EVENT_FLAG_CTRLKEY:print('摁住Ctrl')if flags == cv2.EVENT_FLAG_SHIFTKEY:print('摁住Shift')if flags == cv2.EVENT_FLAG_LBUTTON:print('摁住左键')if flags == cv2.EVENT_FLAG_MBUTTON:print('摁住中键')if flags == cv2.EVENT_FLAG_RBUTTON:print('摁住右键')'''# if event == cv2.EVENT_LBUTTONDBLCLK:#     print('左键双击')# if event == cv2.EVENT_MBUTTONDBLCLK:#     print('中键双击')# if event == cv2.EVENT_RBUTTONDBLCLK:#     print('右键双击')'''if event == cv2.EVENT_LBUTTONDOWN:print('左键击下')if event == cv2.EVENT_LBUTTONUP:print('左键弹起')if event == cv2.EVENT_MBUTTONDOWN:print('中键击下')if event == cv2.EVENT_MBUTTONUP:print('中键弹起')if event == cv2.EVENT_RBUTTONDOWN:print('右键击下')if event == cv2.EVENT_RBUTTONUP:print('右键弹起')'''# if event == cv2.EVENT_MOUSEWHEEL:#     if flags > 0:#         print('向前滚动')#     else:#         print('向后滚动')# if event == cv2.EVENT_MOUSEHWHEEL:#     if flags > 0:#         print('向左滚动')  # 按住Alt#     else:#         print('向右滚动')#choice window
def choice_Windows(scene,file):LR_file = os.path.join(LR_Dir, scene, file)                                     #LR fileif not os.path.exists(LR_file):return 0index = int(file.split(".")[0])+1phase_file = os.path.join(Phase_dir, scene, "rgb_sr_%02d.png" % index)               #phase filebic_file = os.path.join(Bicubic_dir, scene, file)gt_file = os.path.join(GT_Dir, scene, file)msdtgp_file = os.path.join(MSDTGP_Dir, scene, file)LR_img = cv2.imread(LR_file)phase_img = cv2.imread(phase_file)bic_img = cv2.imread(bic_file)gt_img = cv2.imread(gt_file)msdtgp_img = cv2.imread(msdtgp_file)# phase_img = cv2.imread(phase_file)[:,:,::-1]# LR_img = cv2.imread(LR_file)[:,:,::-1]# phase_img = cv2.imread(phase_file)[:,:,::-1]# bic_img = cv2.imread(bic_file)[:,:,::-1]# gt_img = cv2.imread(gt_file)[:,:,::-1]# msdtgp_img = cv2.imread(msdtgp_file)[:,:,pp::-1]# # phase_img = cv2.imread(phase_file)[:,:,::-1]windowname= scenecv2.namedWindow(windowname,cv2.WINDOW_NORMAL)cv2.setMouseCallback(windowname,MouseEvent,(LR_img,phase_img,bic_img,gt_img,msdtgp_img,40,windowname))refreshWindow(LR_img,phase_img,bic_img,gt_img,msdtgp_img,[50,50,100,100],0,0,windowname)#挑选效果图
def choice_scene(scene_dict):scenes=["000","001","002","003","004","005","006","007","008","009"]# scenes=["001","002","003","004","005"]for scene in scenes:files = scene_dict.get(scene)#生成Bicubic的残差结果file_name=random.choices(files)[0]choice_Windows(scene,file_name)# scenes = scene_dict.keys()# scene=random.choice(scenes)# files=scene_dict[scene]# file=random.choice(files)# choice_Windows(scene,file)def main():#获取文件的目录结构scene_files = getFileDict()# product_residual(scene_files)choice_scene(scene_files)print(f"deal ok!")passif __name__ == '__main__':main()

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/48058.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

服务器证书基于 OpenSSL一键颁发脚本

文章目录 一、场景说明二、脚本职责三、参数说明四、操作示例五、注意事项 一、场景说明 本自动化脚本旨在为提高研发、测试、运维快速部署应用环境而编写。 脚本遵循拿来即用的原则快速完成 CentOS 系统各应用环境部署工作。 统一研发、测试、生产环境的部署模式、部署结构、…

vue使用了代理跨域,部署上线,使用Nginx配置出现问题,访问不到后端接口

1、如果路由的mode是history模式的要加上框框里的哪句,然后配置下面的location router location / {root /usr/local/app/dist/; #vue文件dist的完整路径try_files $uri $uri/ router;index index.html index.htm;}#error_page 500 502 503 504 /50x.html;lo…

数据分析入门指南:数据库入门(五)

本文将总结CDA认证考试中数据库中部分知识点,内容来源于《CDA模拟题库与备考资料PPT》 。 CDA认证,作为源自中国、面向全球的专业技能认证,覆盖金融、电信、零售、制造、能源、医疗医药、旅游、咨询等多个行业,旨在培养能够胜任数…

RK3328 Debian安装OpenMediaVault

手头有RK3328板卡,自己编译了Debian并烧录跑起来了,拿它来作为NAS使用,在网上找了一些开源的NAS系统,最终敲定使用OpenMediaVault这套,下面是在RK3328 Debian系统下的安装过程: 0、先打开一个Terminal终端…

CVE-2023-33440(任意文件上传)

简介 Faculty Evaluation System v1.0 存在未授权任意文件上传漏洞漏洞 过程 打开靶场 进行目录扫描 发现后台login.php,进入查看 弱口令进行测试,无效,无法进入 根据提示是未授权访问文件上传 ,应该是不需要登录就能触发漏洞…

分布式Session共享的5类技术方案,与优劣势比较

分布式Session共享是分布式系统中常见的问题,主要解决在多个服务器之间共享用户会话信息的需求。以下是五种常见的分布式Session共享技术方案及其优劣势比较: 1. Session复制 设计思路: 多个Web服务器之间相互同步Session,每个W…

Apple Vision Pro 开发资源大全

Apple Vision Pro 是一款强大的视觉处理设备,为开发者提供了丰富的应用场景和开发资源。以下是与 Apple Vision Pro 相关的应用程序、开发者资源、社区和文章的集合,旨在帮助开发者更好地利用这一平台。 1. Vision Pro 使用技巧 技巧和窍门:提供一系列实用的使用技巧,帮助…

http 协议中GET如何传递参数(Query String)?

因为项目需要,最近在手搓一个Http Connection,目的是实现最简单的Http访问,能通过Get或则Post方法向数数的日志服务器传递数据。之前看过数数提供的开发包,因为服务器用的是C,而数数提供的C/C开发包简陋的吓人&#xf…

openstack设置IP直接登录,不需要加dashboard后缀

openstack 实验环境,openstack-t版,centos2009 修改配置文件 [rootcontroller ~]# vim /WEBROOT /etc/openstack-dashboard/local_settings #将dashboard去掉 WEBROOT /dashboard/ #改为 WEBROOT /[rootcontroller ~]# vim /etc/httpd/conf.d/openst…

深度学习每周学习总结N4:中文文本分类-Pytorch实现(基本分类(熟悉流程)、textCNN分类(通用模型)、Bert分类(模型进阶))

🍨 本文为🔗365天深度学习训练营 中的学习记录博客🍖 原作者:K同学啊 | 接辅导、项目定制 目录 0. 总结:1. 基础模型a. 数据加载b. 数据预处理c. 模型搭建与初始化d. 训练函数e. 评估函数f.拆分数据集运行模型g. 结果可…

C++STL初阶(7):list的运用与初步了解

在了解了vector之后,我们只需要简单学习List与vector不一样的接口即可 1.list的基本接口 1.1 iterator list中,与vector最大的区别就是迭代器由随机迭代器变成双向迭代器 string和vector中的迭代器都是随机迭代器,支持-等,而LIS…

达梦数据库 MPP集群搭建(带主备)

MPP集群搭建(带主备) 1.背景2.操作内容和要求3. 具体步骤3.1 搭建过程3.1.1 集群搭建3.1.2 准备工作3.1.2.1 初始化3.1.2.2 备份数据库 3.1.3 配置主库EP013.1.3.1 配置dm.ini3.1.3.2 配置dmmal.ini3.1.3.3 配置dmarch.ini3.1.3.4 配置dmmpp.ctl3.1.3.5 …

Seata 面试题及答案整理,最新面试题

Seata 是如何解决分布式事务问题的? Seata通过事务协调器、事务管理器和资源管理器三个核心组件来解决分布式事务问题。 1、事务协调器(TC): TC作为全局事务的协调者,负责维护全局和分支事务的状态,并协调全局提交或回滚。 2、事务管理器(TM): TM负责定义全局事务的范…

百度文心大模型4.0 Turbo面向企业开放 多款旗舰模型降价

在2024年世界人工智能大会期间,百度副总裁谢广军宣布了文心一言4.0Turbo模型对企业用户的全面开放,并介绍了其定价策略。文心一言4.0Turbo的输入定价为0.03元/千Tokens,输出定价为0.06元/千Tokens。谢广军指出,如果按照3:1的输入输…

ArcGIS Pro SDK (九)几何 7 多点

ArcGIS Pro SDK (九)几何 7 多点 文章目录 ArcGIS Pro SDK (九)几何 7 多点1 构造多点 - 从映射点的枚举2 构造多点 - 使用 MultipointBuilderEx3 修改多点的点4 从多点检索点、2D 坐标、3D 坐标 环境:Visual Studio 2…

Golang | Leetcode Golang题解之第263题丑数

题目&#xff1a; 题解&#xff1a; var factors []int{2, 3, 5}func isUgly(n int) bool {if n < 0 {return false}for _, f : range factors {for n%f 0 {n / f}}return n 1 }

Linux云计算 |【第一阶段】SERVICES-DAY4

主要内容&#xff1a; DHCP概述、PXE批量装机、配置PXE引导、Kickstart自动应答、Cobbler装机平台 一、DHCP服务概述及原理 DHCP动态主机配置协议&#xff08;Dynamic Host Configuration Protocol&#xff09;&#xff0c;由IETF&#xff08;Internet网络工程师任务小组&…

Ruby教程

Ruby是一种动态的、面向对象的、解释型的脚本语言&#xff0c;以其简洁和易读性而闻名。Ruby的设计哲学强调程序员的生产力和代码的可读性&#xff0c;同时也融合了功能性和面向对象编程的特性。 以下是一个基础的Ruby教程&#xff0c;涵盖了一些基本概念和语法&#xff1a; …

IMU提升相机清晰度

近期&#xff0c;一项来自北京理工大学和北京师范大学的团队公布了一项创新性的研究成果&#xff0c;他们将惯性测量单元&#xff08;IMU&#xff09;和图像处理算法相结合&#xff0c;显著提升了非均匀相机抖动下图像去模糊的准确性。 研究团队利用IMU捕捉相机的运动数据&…

通过 EMR Serverless Spark 提交 PySpark 流任务

在大数据快速发展的时代&#xff0c;流式处理技术对于实时数据分析至关重要。EMR Serverless Spark提供了一个强大而可扩展的平台&#xff0c;它不仅简化了实时数据处理流程&#xff0c;还免去了服务器管理的烦恼&#xff0c;提升了效率。本文将指导您使用EMR Serverless Spark…