当前位置: 首页 > news >正文

华为云API人脸识别服务FRS的感知力—偷偷藏不住的你

云服务、API、SDK,调试,查看,我都行

阅读短文您可以学习到:人工智能AI人脸的识别、检测、搜索、比对

1、IntelliJ IDEA 之API插件介绍

API插件支持 VS Code IDE、IntelliJ IDEA等平台、以及华为云自研 CodeArts IDE,基于华为云服务提供的能力,帮助开发者更高效、便捷的搭建应用。API插件关联华为云服务下的 API Explorer、DevStar、CodeLabs、SDK 中心和 CLI 中心产品,致力于为开发者提供更稳定、快速、安全的编程体验。

在本插件中,我们提供了但不局限于如下的功能:

对接华为云API开放平台,支持用户检索API、查看API文档、调试API、以及提供SDK示例代码供用户学习如何使用API。

提供华为云SDK代码片段补全功能,SDK依赖包自动引入,加速用户集成华为云API。

对接华为云开发体验馆Codelabs,提供500+云服务代码示例,向导式教程帮助用户快速学习。

说明:

在IntelliJ IDEA等系列平台和VS Code IDE,华为云API插件的名称是Huawei Cloud API。而在CodeArts IDE,API插件是IDE原生内置的,名称是华为云API开发套件。

API插件在IntelliJ IDEA等系列平台和VS Code IDE的使用依赖底座插件,请提前安装底座插件。

2、API插件安装--IntelliJ IDEA

2.1 IntelliJ IDEA等平台

安装准备:下载并安装JDK1.8或更高版本。下载并安装IntelliJ IDEA 2020.2或更高版本。

须知:IntellIj平台同时支撑包括Goland、Pycharm等在内的IDE,若在其它相关IDE上开发,请下载配置好对应语言的编译器或者解释器。这里以IDEA为例介绍IntelliJ平台插件的安装流程,其他IntelliJ系列的IDE请参考IDEA。

开始安装:

您可以在直接在IDE插件市场或者直接在JetBrains插件市场下载离线包安装。

https://developer.huaweicloud.com/develop/toolkit.html

IDE安装

  1. 在IntelliJ IDEA顶部菜单栏中选择File > Settings,在Settings对话框的左侧导航栏中单击Plugins。
  2. Plugins区域单击Marketplace,在搜索栏中输入Huawei Cloud API。
  3. Search Results区域会出现Huawei Cloud API,单击Install,完成后重启IDE。

离线包安装:

  1. 进入插件市场搜索Huawei Cloud API,进入插件详情页,在Versions页签下选择想要版本的API插件,点击Download下载离线的插件压缩包保存到本地。。
  2. 在IntelliJ IDEA顶部菜单栏中选择File > Settings,在Settings对话框的左侧导航栏中单击Plugins。
  3. 在Plugins区域单击 ,再单击Install Plugin from Disk...。
  4. 在Choose Plugin File对话框中选择离线安装包(不用解压),并按照IntelliJ IDEA安装页面的提示,完成后续安装步骤。

说明:若当前您想要安装插件的IntelliJ IDE已经在桌面打开,则进入插件市场搜索Huawei Cloud API,进入插件详情页,在右上角会识别到本地已经打开的IDE,点击相应按钮,在弹出的IDE窗口中点击ok,则IDE后台会开始安装相应版本的API插件。

安装验证:在IntelliJ系列平台上安装插件成功后在左侧的导航栏中可以看到Huawei Cloud Toolkit图标,点击后面板会出现Huawei Cloud API的字样,则说明安装成功。

2.2 华为云API

Toolkit-华为云

左侧展示API列表,可以查询所有API,目前云服务206,APIs9213

3、抓住偷偷藏不住的你

3.1 前期准备

华为云提供了人脸识别服务端SDK,您可以直接集成服务端SDK来调用人脸识别服务的相关API,从而实现对人脸识别服务的快速操作。

该示例展示了如何通过Java版SDK实现人脸识别。

开发前准备:

  • 已注册华为云,并完成实名认证 。
  • 已订阅人脸识别服务。
  • 已具备开发环境,支持Java JDK 1.8及其以上版本。
  • 已获取华为云账号对应的Access Key(AK)和Secret Access Key(SK)。请在华为云控制台“我的凭证 > 访问密钥”页面上创建和查看您的AK/SK。具体请参见 访问密钥 。
  • 已获取直播服务对应区域的项目ID,请在华为云控制台“我的凭证 > API凭证”页面上查看项目ID。具体请参见 API凭证。

安装SDK:

您可以通过Maven配置所依赖的人脸识别服务SDK

<dependency><groupId>com.huaweicloud.sdk</groupId><artifactId>huaweicloud-sdk-frs</artifactId><version>3.1.19</version></dependency>

开始使用:

导入依赖模块

import com.huaweicloud.sdk.core.auth.ICredential;import com.huaweicloud.sdk.core.auth.BasicCredentials;import com.huaweicloud.sdk.core.exception.ConnectionException;import com.huaweicloud.sdk.core.exception.RequestTimeoutException;import com.huaweicloud.sdk.core.exception.ServiceResponseException;

//v2版本sdk

import com.huaweicloud.sdk.frs.v2.region.FrsRegion;import com.huaweicloud.sdk.frs.v2.*;import com.huaweicloud.sdk.frs.v2.model.*;

初始化认证信息

public static ICredential getCredential(String ak, String sk) {return new BasicCredentials().withAk(ak).withSk(sk);}

相关参数说明如下所示:

ak:华为云账号Access Key。

sk:华为云账号Secret Access Key 。

初始化人脸识别服务的客户端

public static FrsClient getClient(Region region, ICredential auth) {// 初始化人脸识别服务的客户端return FrsClient.newBuilder().withCredential(auth).withRegion(region) // 选择服务所在区域 FrsRegion.CN_NORTH_4.build();}

相关参数说明如下所示:

service region: 服务所在区域,例如:

CN_NORTH_1 北京一

CN_NORTH_4 北京四

SDK demo代码解析

3.2 人脸识别/检测

DetectFaceByBase64Request detectRequest = new DetectFaceByBase64Request();
FaceDetectBase64Req faceDetectBase64Req = new FaceDetectBase64Req();
faceDetectBase64Req.withImageBase64("/9j/4AAQSkZJRgABAQAAAQABAAD...");
faceDetectBase64Req.withAttributes("2");
detectRequest.setBody(faceDetectBase64Req);
try {DetectFaceByBase64Response detectResponse = client.detectFaceByBase64(detectRequest);System.out.println(detectResponse.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}
3.2.1	人脸比对
CompareFaceByBase64Request compareRequest = new CompareFaceByBase64Request();
FaceCompareBase64Req faceCompareBase64Req = new FaceCompareBase64Req();
faceCompareBase64Req.withImage1Base64("/9j/4AAQSkZJRgABAQAAAQABAAD...");
faceCompareBase64Req.withImage2Base64("/9j/4AAQSkZJRgABAQAAAQABAAD...");
compareRequest.withBody(faceCompareBase64Req);
try {CompareFaceByBase64Response compareResponse = client.compareFaceByBase64(compareRequest);System.out.println(compareResponse.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}

3.2.2 人脸搜索

SearchFaceByBase64Request searchRequest = new SearchFaceByBase64Request();
searchRequest.withFaceSetName("face_set_name");
FaceSearchBase64Req faceSearchBase64Req = new FaceSearchBase64Req();
List<Map<String, String>> listbodySort = new ArrayList<>();
Map<String, String> map = new HashMap<>();
map.put("timestamp","asc");
listbodySort.add(map);
List<String> listbodyReturnFields = new ArrayList<>();
listbodyReturnFields.add("timestamp");
listbodyReturnFields.add("id");
faceSearchBase64Req.withSort(listbodySort);
faceSearchBase64Req.withReturnFields(listbodyReturnFields);
faceSearchBase64Req.withImageBase64("/9j/4AAQSkZJRgABAQAAAQABAAD...");
searchRequest.withBody(faceSearchBase64Req);
try {SearchFaceByBase64Response searchResponse = client.searchFaceByBase64(searchRequest);System.out.println(searchResponse.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}

创建人脸库

CreateFaceSetRequest createFaceSetRequest = new CreateFaceSetRequest();
CreateFaceSetReq createFaceSetReq = new CreateFaceSetReq();
createFaceSetReq.withFaceSetName("face_set_name");
Map<String, TypeInfo> stringTypeInfoMap = new HashMap<>();
TypeInfo typeInfo = new TypeInfo();
typeInfo.withType("long");
stringTypeInfoMap.put("timestamp", typeInfo);
createFaceSetReq.withExternalFields(stringTypeInfoMap);
createFaceSetRequest.withBody(createFaceSetReq);
try {CreateFaceSetResponse createFaceSetResponse = client.createFaceSet(createFaceSetRequest);System.out.println(createFaceSetResponse.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}

查询人脸库

ShowFaceSetRequest showFaceSetRequest = new ShowFaceSetRequest();
showFaceSetRequest.withFaceSetName("face_set_name");
try {ShowFaceSetResponse showFaceSetResponse = client.showFaceSet(showFaceSetRequest);System.out.println(showFaceSetResponse.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}

查询所有人脸库

ShowAllFaceSetsRequest showAllFaceSetsRequest = new ShowAllFaceSetsRequest();
try {ShowAllFaceSetsResponse showAllFaceSetsResponse = client.showAllFaceSets(showAllFaceSetsRequest);System.out.println(showAllFaceSetsResponse.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}

删除人脸库

DeleteFaceSetRequest deleteFaceSetRequest = new DeleteFaceSetRequest();
deleteFaceSetRequest.withFaceSetName("face_set_name");
try {DeleteFaceSetResponse deleteFaceSetResponse = client.deleteFaceSet(deleteFaceSetRequest);System.out.println(deleteFaceSetResponse.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}

添加人脸

//add face
AddFacesByBase64Request addFacesByBase64Request = new AddFacesByBase64Request();
addFacesByBase64Request.withFaceSetName("face_set_name");
AddFacesBase64Req addFacesBase64Req = new AddFacesBase64Req();
addFacesBase64Req.withExternalFields("{\"timestamp\":12}");
addFacesBase64Req.withImageBase64("9j/4AAQSkZJRgABAQAAAQABAAD...");
addFacesByBase64Request.withBody(addFacesBase64Req);
try {AddFacesByBase64Response addFacesByBase64Response = client.addFacesByBase64(addFacesByBase64Request);System.out.println(addFacesByBase64Response.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}

删除人脸

//delete face by faceId
DeleteFaceByFaceIdRequest deleteFaceByFaceIdRequest = new DeleteFaceByFaceIdRequest();
deleteFaceByFaceIdRequest.withFaceSetName("face_set_name");
deleteFaceByFaceIdRequest.withFaceId("iexEBb6t");
try {DeleteFaceByFaceIdResponse deleteFaceByFaceIdResponse = client.deleteFaceByFaceId(deleteFaceByFaceIdRequest);System.out.println(deleteFaceByFaceIdResponse.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}

批量删除人脸

BatchDeleteFacesRequest batchDeleteFacesRequest = new BatchDeleteFacesRequest();
batchDeleteFacesRequest.withFaceSetName("face_set_name");
DeleteFacesBatchReq deleteFacesBatchReq = new DeleteFacesBatchReq();
deleteFacesBatchReq.withFilter("age:[20 TO 30]");
batchDeleteFacesRequest.withBody(deleteFacesBatchReq);
try {BatchDeleteFacesResponse batchDeleteFacesResponse = client.batchDeleteFaces(batchDeleteFacesRequest);System.out.println(batchDeleteFacesResponse.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}

更新人脸

UpdateFaceRequest updateFaceRequest = new UpdateFaceRequest();
updateFaceRequest.withFaceSetName("face_set_name");
UpdateFaceReq updateFaceReq = new UpdateFaceReq();
updateFaceReq.withFaceId("iexEBb6t");
updateFaceRequest.withBody(updateFaceReq);
try {UpdateFaceResponse response = client.updateFace(updateFaceRequest);System.out.println(response.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}

查询人脸

//show faces by faceId
ShowFacesByFaceIdRequest showFacesByFaceIdRequest = new ShowFacesByFaceIdRequest();
showFacesByFaceIdRequest.withFaceSetName("face_set_name");
showFacesByFaceIdRequest.withFaceId("iexEBb6t");
try {ShowFacesByFaceIdResponse response = client.showFacesByFaceId(showFacesByFaceIdRequest);System.out.println(response.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}

3.3 活体识别/检测

3.3.1 动作活体检测

//detect live by base64
DetectLiveByBase64Request request = new DetectLiveByBase64Request();
LiveDetectBase64Req body = new LiveDetectBase64Req();
body.withActions("1,2,3,4");
body.withVideoBase64("/9j/4AAQSkZJRgABAQAAAQABAAD...");
request.withBody(body);
try {DetectLiveByBase64Response response = client.detectLiveByBase64(request);System.out.println(response.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}

3.3.2默活体检测

//detect live face by base64
DetectLiveFaceByBase64Request request = new DetectLiveFaceByBase64Request();
LiveDetectFaceBase64Req body = new LiveDetectFaceBase64Req();
body.withImageBase64("/9j/4AAQSkZJRgABAQAAAQABAAD...");
request.withBody(body);
try {DetectLiveFaceByBase64Response response = client.detectLiveFaceByBase64(request);System.out.println(response.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}

3.4人脸搜索

SearchFaceByBase64Request searchRequest = new SearchFaceByBase64Request();
searchRequest.withFaceSetName("face_set_name");
FaceSearchBase64Req faceSearchBase64Req = new FaceSearchBase64Req();
List<Map<String, String>> listbodySort = new ArrayList<>();
Map<String, String> map = new HashMap<>();
map.put("timestamp","asc");
listbodySort.add(map);
List<String> listbodyReturnFields = new ArrayList<>();
listbodyReturnFields.add("timestamp");
listbodyReturnFields.add("id");
faceSearchBase64Req.withSort(listbodySort);
faceSearchBase64Req.withReturnFields(listbodyReturnFields);
faceSearchBase64Req.withImageBase64("/9j/4AAQSkZJRgABAQAAAQABAAD...");
searchRequest.withBody(faceSearchBase64Req);
try {SearchFaceByBase64Response searchResponse = client.searchFaceByBase64(searchRequest);System.out.println(searchResponse.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}

3.5 人脸比对

CompareFaceByBase64Request compareRequest = new CompareFaceByBase64Request();
FaceCompareBase64Req faceCompareBase64Req = new FaceCompareBase64Req();
faceCompareBase64Req.withImage1Base64("/9j/4AAQSkZJRgABAQAAAQABAAD...");
faceCompareBase64Req.withImage2Base64("/9j/4AAQSkZJRgABAQAAAQABAAD...");
compareRequest.withBody(faceCompareBase64Req);
try {CompareFaceByBase64Request compareRequest = new CompareFaceByBase64Request();
FaceCompareBase64Req faceCompareBase64Req = new FaceCompareBase64Req();
faceCompareBase64Req.withImage1Base64("/9j/4AAQSkZJRgABAQAAAQABAAD...");
faceCompareBase64Req.withImage2Base64("/9j/4AAQSkZJRgABAQAAAQABAAD...");
compareRequest.withBody(faceCompareBase64Req);
try {CompareFaceByBase64Response compareResponse = client.compareFaceByBase64(compareRequest);System.out.println(compareResponse.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}CompareFaceByBase64Response compareResponse = client.compareFaceByBase64(compareRequest);System.out.println(compareResponse.toString());
} catch (ConnectionException e) {e.printStackTrace();
} catch (RequestTimeoutException e) {e.printStackTrace();
} catch (ServiceResponseException e) {e.printStackTrace();System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());
}

4、偷偷藏不住的你

身份验证

使用人脸检测与比对功能,可进行身份核实,适用于机场、海关等人证合一验证场景。

电子考勤

人脸检测及比对功能适用于客户企业对员工进行电子考勤。

客流分析

客流分析对于商场具有重要价值。基于人脸识别、搜索技术,帮助客户精准营销。

5、参考文献

https://support.huaweicloud.com/usermanual-cbs/cbs_01_0029.html

https://console.huaweicloud.com/cbs/?region=cn-north-4#/cbs/management/skills

6、体验插件的魅力

华为云devkit已上线:https://developer.huaweicloud.com/develop/toolkit.html

相关文章:

华为云API人脸识别服务FRS的感知力—偷偷藏不住的你

云服务、API、SDK&#xff0c;调试&#xff0c;查看&#xff0c;我都行 阅读短文您可以学习到&#xff1a;人工智能AI人脸的识别、检测、搜索、比对 1、IntelliJ IDEA 之API插件介绍 API插件支持 VS Code IDE、IntelliJ IDEA等平台、以及华为云自研 CodeArts IDE&#xff0c;…...

产品技术体系

产品&#xff0c;是一个企业或公司针对市场客户推出的一系列相关的功能或者服务&#xff0c;为对应的客户解决实际问题&#xff0c;进而产生对应的商业、社会价值。有了这些实际的价值&#xff0c;企业就会获得相应的利益或者利润回报。正常来讲&#xff0c;这应该是一个良性的…...

Docker从认识到实践再到底层原理(二-3)|LXC容器

前言 那么这里博主先安利一些干货满满的专栏了&#xff01; 首先是博主的高质量博客的汇总&#xff0c;这个专栏里面的博客&#xff0c;都是博主最最用心写的一部分&#xff0c;干货满满&#xff0c;希望对大家有帮助。 高质量博客汇总 然后就是博主最近最花时间的一个专栏…...

[运维|docker] ubuntu镜像更新时报E: Problem executing scripts APT::Update::Post-Invoke错误

参考文献 docker-ce在ubuntu:22.04进行apt update时报错E: Problem executing scripts APT::Update::Post-Invoke 详细报错信息 E: Problem executing scripts APT::Update::Post-Invoke rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/c…...

计算机网络的故事——HTTP首部

HTTP首部 在HTTP协议通信交互中使用的首部字段。不限于RFC2616中定义的47种首部字段&#xff0c;还有Cookie、setCookie和Content-Disposition等 HTTP 首部字段将定义成缓存代理和非缓存代理的行为&#xff0c;分成 2 种类型。端到端首部和逐跳首部...

js农历与阳历转换使用笔记

1、新建utils/dateChange.js /*** 1900-2100区间内的公历、农历互转* charset UTF-8* Author jiangjiazhi* 公历转农历&#xff1a;calendar.solar2lunar(1987,11,01); //[you can ignore params of prefix 0]* 农历转公历&#xff1a;calendar.lunar2solar(1987,09,10); //[…...

苹果与芯片巨头Arm达成20年新合作协议,将继续采用芯片技术

9月6日消息&#xff0c;据外媒报道&#xff0c;芯片设计巨头Arm宣布在当地时间周二提交给美国证券交易委员会&#xff08;SEC&#xff09;的最新IPO文件中&#xff0c;透露与苹果达成了一项长达20年的新合作协议&#xff0c;加深了双方之间的合作关系。 报道称&#xff0c;虽然…...

Linux下systemd深入指南:如何优化Java服务管理与开机自启配置

&#x1f337;&#x1f341; 博主猫头虎&#xff08;&#x1f405;&#x1f43e;&#xff09;带您 Go to New World✨&#x1f341; &#x1f984; 博客首页——&#x1f405;&#x1f43e;猫头虎的博客&#x1f390; &#x1f433; 《面试题大全专栏》 &#x1f995; 文章图文…...

PMOS阵列(PMOS阵列代替)

pmos阵列没有找到&#xff0c;不过高压侧驱动芯片倒是可以使用VN340SP Datasheet - VN340SP-E & VN340SP-33-E - Quad high-side smart power solid-state relayhttps://www.st.com/resource/en/datasheet/vn340sp-33-e.pdf VN340SP-E - 四通道高侧智能功率固态继电器 - 意…...

Linux常见指令

1、ls指令 语法&#xff1a; ls [选项][目录或文件] 功能&#xff1a;对于目录&#xff0c;该命令列出该目录下的所有子目录与文件。对于文件&#xff0c;将列出文件名以及其他信息。 常用选项&#xff1a; -a 列出目录下的所有文件&#xff0c;包括以 . 开头的隐含文件-l 列出…...

让开发回归简单模式-组件封装

对于工作年限不长的程序员来说&#xff0c;知识储备是非常关键的。在开发中各种技术的应用已经非常普遍了&#xff0c;例如常见的各种ORM,各种中间件如Redis&#xff0c;MQ等等&#xff0c;又如WebApi路由配置等等&#xff0c;对于常常做开发的程序员来说&#xff0c;都是小事&…...

LED显示屏安全亮度参数设置方法和防护

随着LED显示屏应用领域越来越广&#xff0c;但其高亮度造成的光污染&#xff0c;常受到的人们的诟病。为了更好的避免光污染&#xff0c;我整理了一些关于LED显示安全亮度参数设置方法和安全防护措施。你知道LED广告牌是如何工作的吗&#xff1f; 设置LED显示屏的安全亮度参数和…...

数据库sql--关于计算方圆5公里点位编写

当我们计算两个地球上任意两点之间的距离时&#xff0c;可以使用Haversine公式。 下面是每个函数和数值的详细解释&#xff1a; RADIANS(target_latitude)&#xff1a;将目标纬度值转换为弧度制。这是因为Haversine公式以弧度为单位计算角度。RADIANS(latitude)&#xff1a;将…...

嵌入式基础知识-DMA

本篇来介绍DMA的一些基础知识。 1 DMA简介 DMA&#xff08;Direct Memory Access&#xff09;,中文名为直接内存访问&#xff0c;它是一些计算机总线架构提供的功能&#xff0c;能使数据从附加设备&#xff08;如磁盘驱动器&#xff09;直接发送到计算机主板的内存上。对应嵌…...

STM32 软件IIC 控制OLED 显示屏

1. 硬件IIC 实在是太难用了&#xff0c;各种卡死&#xff0c;各种发不出来数据&#xff0c;没那么多时间折腾了&#xff0c;还是用软件IIC 先吧&#xff0c;初始化 void OLED_Software_IIC_Init(void) {GPIO_InitTypeDef GPIO_InitStruct;RCC_AHBPeriphClockCmd(OLED_SOFTWARE…...

【系统设计系列】 DNS和CDN

系统设计系列初衷 System Design Primer&#xff1a; 英文文档 GitHub - donnemartin/system-design-primer: Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards. 中文版&#xff1a; https://github.com/donnemarti…...

thinkphp中使用Elasticsearch 7.0进行多表的搜索

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 前言一、thinkphp中使用Elasticsearch 7.0进行多表的搜索二、使用步骤1.引入库2.读入数据 总结 前言 提示&#xff1a;thinkphp中使用Elasticsearch 7.0进行多表的…...

说说 TCP的粘包、拆包

分析&回答 拆包和粘包是在socket编程中经常出现的情况&#xff0c; 在socket通讯过程中&#xff0c;如果通讯的一端一次性连续发送多条数据包&#xff0c;tcp协议会将多个数据包打包成一个tcp报文发送出去&#xff0c;这就是所谓的粘包。如果通讯的一端发送的数据包超过一…...

PowerToys安装

PowerToys 是微软开发者开发的免费实用工具集&#xff0c;可以用于高级用户调整和简化 Windows 操作&#xff0c;以提高效率。 官网安装方法&#xff1a; https://learn.microsoft.com/zh-cn/windows/powertoys/install 目前安装文件路径&#xff1a; https://github.com/m…...

Unity——LitJSON的安装

一、LitJSON介绍 特点 LitJSON是一个轻量级的C# JSON库&#xff0c;用于在Unity游戏开发中进行JSON数据的序列化和反序列化操作。它提供了简单而高效的接口&#xff0c;帮助开发者处理JSON数据。 以下是LitJSON库的一些主要特点和功能&#xff1a; 1. 高性能&#xff1a;Lit…...

YOLOv5:对yolov5n模型进一步剪枝压缩

YOLOv5&#xff1a;对yolov5n模型进一步剪枝压缩 前言前提条件相关介绍具体步骤修改yolov5n.yaml配置文件单通道数据&#xff08;黑白图片&#xff09;修改models/yolo.py文件修改train.py文件 剪枝后模型大小 参考 前言 由于本人水平有限&#xff0c;难免出现错漏&#xff0c;…...

大数据(八):Pandas的基础应用详解(五)

专栏介绍 结合自身经验和内部资料总结的Python教程,每天3-5章,最短1个月就能全方位的完成Python的学习并进行实战开发,学完了定能成为大佬!加油吧!卷起来! 全部文章请访问专栏:《Python全栈教程(0基础)》 再推荐一下最近热更的:《大厂测试高频面试题详解》 该专栏对…...

【算法】归并排序 详解

归并排序 详解 归并排序代码实现1. 递归版本2. 非递归版本 排序&#xff1a; 排序&#xff0c;就是使一串记录&#xff0c;按照其中的某个或某些关键字的大小&#xff0c;递增或递减的排列起来的操作。 稳定性&#xff1a; 假定在待排序的记录序列中&#xff0c;存在多个具有相…...

linux 进程隔离Namespace 学习

一、linux namespace 介绍 1.1、概念 Linux Namespace是Linux内核提供的一种机制&#xff0c;它用于隔离不同进程的资源视图&#xff0c;使得每个进程都拥有独立的资源空间&#xff0c;从而实现进程之间的隔离和资源管理。 Linux Namespace的设计目标是为了解决多个进程之间…...

【MySQL】事务 详解

事务 详解 一. 为什么使用事务二. 事务的概念三. 使用四. 事务的特性原子性&#xff08;Atomicity&#xff09;一致性&#xff08;Consistency&#xff09;隔离性&#xff08;Isolation&#xff09;持久性&#xff08;Durability&#xff09; 五. 事务并发所带来的问题脏读问题…...

爬虫到底难在哪里?

目录 爬虫到底难在哪里 怎么学习爬虫 注意事项 爬虫工具 总结 学习Python爬虫的难易程度因人而异&#xff0c;对于具备编程基础的人来说&#xff0c;学习Python爬虫并不困难。Python语言本身比较简单易学&#xff0c;适合初学者使用。 爬虫到底难在哪里 爬虫的难点主要包…...

linux常用命令行整理

1、linux的以及目录 bin 二进制可执行文件sbin 二进制可执行文件(root用户权限)etc 系统管理和配置文件,例如常见host文件home 用户文件的根目录usr 用户存放系统应用程序(共享系统资源)opt 可选的应用程序proc 虚拟文件系统root 超级用户dev 存放设备文件mnt 系统管理员安装临…...

python字符串相关

python字符串相关 一、reverse() 函数 只能反转 列表二、reversed() 反转元组字符串等等 返回迭代器三、join和reversed反转字符串四、join串联字符串&#xff08;join连接对象仅限字符串、储存字符串的元组、列表、字典&#xff09;数字对象可通过str()转化为字符串⭐对象为字…...

JavaScript学习笔记01

JavaScript笔记01 什么是 JavaScript JavaScript 是一门世界上最流行的脚本语言&#xff0c;它是一种弱类型的脚本语言&#xff0c;其代码不需要经过编译&#xff0c;而是由浏览器解释运行&#xff0c;用于控制网页的行为。 发展历史 参考&#xff1a;JavaScript的起源故事…...

golang 通用的 grpc http 基础开发框架

go-moda golang 通用的 grpc http 基础开发框架仓库地址: https://github.com/webws/go-moda仓库一直在更新,欢迎大家吐槽和指点 特性 transport: 集成 http&#xff08;echo、gin&#xff09;和 grpc。tracing: openTelemetry 实现微务链路追踪pprof: 分析性能config: 通用…...