【案例教学】华为云API图像搜索ImageSearch的快捷性—AI帮助您快速归类图片

云服务、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。https://developer.huaweicloud.com/develop/toolkit.html

开始安装:

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

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列表

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

Toolkit-华为云

版本说明

本示例基于华为云SDK V3.0版本开发

功能介绍

创建实例,实例中会生成图片索引库,用来存放图片特征。

该示例展示了如何通过java版SDK实现创建实例。

前置条件

获取AK/SK

开发者在使用前需先获取账号的ak、sk、endpoint。

您需要拥有华为云账号以及该账号对应的 Access Key(AK)和 Secret Access Key(SK)。请在华为云控制台“我的凭证-访问密钥”页面上创建和查看您的 AK/SK。更多信息请查看访问密钥。

endpoint 华为云各服务应用区域和各服务的终端节点,详情请查看地区和终端节点。

运行环境

Java JDK 1.8 及其以上版本,推荐通过Maven 安装依赖的方式使用JAVA版本SDK。

SDK获取和安装

在Maven 项目的 pom.xml 文件加入相应版本的依赖项即可。

以引入3.0.67版本的内容审核SDK为例:

<dependency>

    <groupId>com.huaweicloud.sdk</groupId>

    <artifactId>huaweicloud-sdk-imagesearch</artifactId>

    <version>3.0.67</version>

</dependency>

3 创建图像搜索实例

图像内容审核示例代码只需将AK/SK信息替换为实际AK/SK,代码中可以使用CreateInstanceReq类的setName或setModel方法配置实例名称和模型名称,配置完成后运行即可。

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;
import com.huaweicloud.sdk.imagesearch.v1.ImageSearchClient;
import com.huaweicloud.sdk.imagesearch.v1.model.RunCreateInstanceRequest;
import com.huaweicloud.sdk.imagesearch.v1.model.CreateInstanceReq;
import com.huaweicloud.sdk.imagesearch.v1.model.RunCreateInstanceResponse;
import com.huaweicloud.sdk.imagesearch.v1.region.ImageSearchRegion;public class ImageSearchCreateInstanceDemo {public static void main(String[] args) {String ak = "<YOUR AK>";String sk = "<YOUR SK>";ICredential auth = new BasicCredentials().withAk(ak).withSk(sk);ImageSearchClient client = ImageSearchClient.newBuilder().withCredential(auth).withRegion(ImageSearchRegion.valueOf("cn-north-4")).build();RunCreateInstanceRequest request = new RunCreateInstanceRequest();CreateInstanceReq body = new CreateInstanceReq();body.setName("instance-name");body.setModel("common-search");request.setBody(body);try {RunCreateInstanceResponse response = client.runCreateInstance(request);System.out.println(response.toString());} catch (ConnectionException e) {System.out.println(e.getMessage());} catch (RequestTimeoutException e) {System.out.println(e.getMessage());} catch (ServiceResponseException e) {System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());}}
}

4 删除图像搜索实例

删除实例示例代码只需将AK/SK信息替换为实际AK/SK,代码中可以使用RunDeleteInstanceRequest类的setInstanceName方法配置实例名称,配置完成后运行即可。

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;
import com.huaweicloud.sdk.imagesearch.v1.ImageSearchClient;
import com.huaweicloud.sdk.imagesearch.v1.model.RunDeleteInstanceRequest;
import com.huaweicloud.sdk.imagesearch.v1.model.RunDeleteInstanceResponse;
import com.huaweicloud.sdk.imagesearch.v1.region.ImageSearchRegion;public class ImageSearchDeleteInstanceDemo {public static void main(String[] args) {String ak = "<YOUR AK>";String sk = "<YOUR SK>";ICredential auth = new BasicCredentials().withAk(ak).withSk(sk);ImageSearchClient client = ImageSearchClient.newBuilder().withCredential(auth).withRegion(ImageSearchRegion.valueOf("cn-north-4")).build();RunDeleteInstanceRequest request = new RunDeleteInstanceRequest();request.setInstanceName("instance-name");try {RunDeleteInstanceResponse response = client.runDeleteInstance(request);System.out.println(response.toString());} catch (ConnectionException e) {System.out.println(e.getMessage());} catch (RequestTimeoutException e) {System.out.println(e.getMessage());} catch (ServiceResponseException e) {System.out.println(e.getHttpStatusCode());System.out.println(e.getErrorCode());System.out.println(e.getErrorMsg());}}
}

5 相册中筛选同类型的相片合并归类

使用如下代码(来自ImageSearchService.py)同步查询特定 Region 下的图像搜索服务(IS),调用前请根据实际情况替换如下变量 {your ak string}、{your sk string}、{your region string}、{your endpoint string} 、{your projectId string} 以及 {your file path string}

class ImageSearchService(object):def __init__(self, service_name, region, ak, sk, end_point_url, project_id):self.end_point_url = end_point_urlself.project_id = project_idself.sig = signer.Signer()self.sig.Key = akself.sig.Secret = skself.name = service_nameself.region = regiondef create_instance(self, project_id, model, name, description="", tags=["test-tags"]):uri = "https://imagesearch.cn-north-4.myhuaweicloud.com/v1/%s/service"%project_iddata = {"project_id": project_id,"model": model,"name": name,"description": description,"tags": tags}json_data = json.dumps(data)r = signer.HttpRequest("POST", uri)r.body = json_datar.headers = {"content-type": "application/json"}self.sig.Sign(r)resp = requests.request(r.method, r.scheme+"://"+r.host+r.uri, headers=r.headers, data=r.body)# print(resp.status_code, resp.reason)# print(resp.content)return respdef delete_instance(self, project_id, instance_name):uri = "https://imagesearch.cn-north-4.myhuaweicloud.com/v1/%s/service/%s"%(project_id, instance_name)data = {}json_data = json.dumps(data)r = signer.HttpRequest("DELETE", uri)r.body = json_datar.headers = {"content-type": "application/json"}self.sig.Sign(r)resp = requests.request(r.method, r.scheme+"://"+r.host+r.uri, headers=r.headers, data=r.body)# print(resp.status_code, resp.reason)# print(resp.content)return respdef check_user_instance(self, end_point_url, project_id, instance_name):uri = "%s/v1/%s/service/%s"%(end_point_url, project_id, instance_name)print(uri)data = {}json_data = json.dumps(data)r = signer.HttpRequest("GET", uri)r.body = json_datar.headers = {"content-type": "application/json"}self.sig.Sign(r)resp = requests.request(r.method, r.scheme+"://"+r.host+r.uri, headers=r.headers, data=r.body)# print(resp.status_code, resp.reason)# print(resp.content)return respdef add_picture(self, project_id, instance_name, path, file="", is_crop=False, tags={"test-tags": "test-default"}):print("call add_picture: %s, length of file path %d"%(path, len(path)))uri = "https://imagesearch.cn-north-4.myhuaweicloud.com/v1/%s/%s/image"%(project_id, instance_name)# print(uri)data = {}data["path"] = pathdata["file"] = filedata["tags"] = tagsjson_data = json.dumps(data)r = signer.HttpRequest("POST", uri)r.body = json_datar.headers = {"content-type": "application/json"}self.sig.Sign(r)resp = requests.request(r.method, r.scheme+"://"+r.host+r.uri, headers=r.headers, data=r.body)# print(resp.status_code, resp.reason)# print(resp.content)return respdef search_picture(self, project_id, instance_name, path="", box={"height": 0, "width": 0, "x": 0, "y": 0}, file="", is_crop=False, limit=0, offset=0):uri = "https://imagesearch.cn-north-4.myhuaweicloud.com/v1/%s/%s/image/search"%(project_id, instance_name)data = {}data["path"] = pathdata["file"] = filejson_data = json.dumps(data)r = signer.HttpRequest("POST", uri)r.body = json_datar.headers = {"content-type": "application/json"}self.sig.Sign(r)resp = requests.request(r.method, r.scheme+"://"+r.host+r.uri, headers=r.headers, data=r.body)# print(resp.status_code, resp.reason)# print(resp.content)return respdef delete_picture(self, project_id, instance_name, path):uri = "https://imagesearch.cn-north-4.myhuaweicloud.com/v1/%s/%s/image"%(project_id, instance_name)data = {}data["path"] = pathjson_data = json.dumps(data)r = signer.HttpRequest("DELETE", uri)r.body = json_datar.headers = {"content-type": "application/json"}self.sig.Sign(r)resp = requests.request(r.method, r.scheme+"://"+r.host+r.uri, headers=r.headers, data=r.body)# print(resp.status_code, resp.reason)# print(resp.content)return respdef check_picture(self, project_id, instance_name, path):uri = "https://imagesearch.cn-north-4.myhuaweicloud.com/v1/%s/%s/image/check"%(project_id, instance_name)data = {}data["path"] = pathjson_data = json.dumps(data)r = signer.HttpRequest("POST", uri)r.body = json_datar.headers = {"content-type": "application/json"}self.sig.Sign(r)resp = requests.request(r.method, r.scheme+"://"+r.host+r.uri, headers=r.headers, data=r.body)# print(resp.status_code, resp.reason)# print(resp.content)return respdef update_picture(self, project_id, instance_name, path, tags={}):uri = "https://imagesearch.cn-north-4.myhuaweicloud.com/v1/%s/%s/image"%(project_id, instance_name)data = {}data["path"] = pathdata["tags"] = tagsjson_data = json.dumps(data)r = signer.HttpRequest("PUT", uri)r.body = json_datar.headers = {"content-type": "application/json"}self.sig.Sign(r)resp = requests.request(r.method, r.scheme+"://"+r.host+r.uri, headers=r.headers, data=r.body)# print(resp.status_code, resp.reason)# print(resp.content)return resp

运行示例

执行bash config.bash,脚本会自动python环境相关的依赖,然后根据系统提示输入AK,SK,Project ID。

配置成功后会自动生成cfg.ini,内容类似,其中hwc部分的配置和配置的结果保持一致。当然,你也可以手动配置cfg.ini文件。

[hwc]ak=******sk=******project_id=63kkdjkd******9dkst3tskdgi53[endpoint]cn-north-1=https://imagesearch.cn-north-1.myhuaweicloud.comcn-north-4=https://imagesearch.cn-north-4.myhuaweicloud.comap-southeast-1=https://imagesearch.ap-southeast-1.myhuaweicloud.com

输入python3 unit_test.py执行单元测试

输入python3 run.py执行演示程序

运行结果

单元测试输出

create_instance 
.check_user_instance is_788802
https://imagesearch.cn-north-4.myhuaweicloud.com/v1/your_project_id/service/is_788802
<Response [200]>
.add_picture_by_local is_788802
call add_picture: ./test_picture/43474673_7bb4465a86.jpg, length of file path 38
.add_picture_by_url is_788802
call add_picture: https://is-smirk.obs.cn-north-4.myhuaweicloud.com:443/flowers_recognition/train/11405573_24a8a838cc_n.jpg, length of file path 105
.search_picture_by_local is_788802
.search_picture_by_url is_788802
.update_picture is_788802
.check_picture is_788802
.delete_picture is_788802
.delete_instance is_788802
.

Ran 10 tests in 18.108s

OK

演示程序输出

['hwc', 'endpoint']
[('cn-north-1', 'https://imagesearch.cn-north-1.myhuaweicloud.com'), ('cn-north-4', 'https://imagesearch.cn-north-4.myhuaweicloud.com'), ('ap-southeast-1', 'https://imagesearch.ap-southeast-1.myhuaweicloud.com')]
https://imagesearch.cn-north-1.myhuaweicloud.com
your_AK
https://imagesearch.cn-north-4.myhuaweicloud.com/v1/your_project_id/service/hwc_demo
call add_picture: 151385301_153eacf6b5_n.jpg, length of file path 26
add picture success: ./test_picture/train/151385301_153eacf6b5_n.jpg
call add_picture: 200557977_bf24d9550b.jpg, length of file path 24
add picture success: ./test_picture/train/200557977_bf24d9550b.jpg
call add_picture: 6953297_8576bf4ea3.jpg, length of file path 22
add picture success: ./test_picture/train/6953297_8576bf4ea3.jpg
call add_picture: 134409839_71069a95d1_m.jpg, length of file path 26
add picture success: ./test_picture/train/134409839_71069a95d1_m.jpg
call add_picture: 510874382_f7e3435043.jpg, length of file path 24
add picture success: ./test_picture/train/510874382_f7e3435043.jpg
call add_picture: 15987457_49dc11bf4b.jpg, length of file path 23
add picture success: ./test_picture/train/15987457_49dc11bf4b.jpg
call add_picture: 164670176_9f5b9c7965.jpg, length of file path 24
add picture success: ./test_picture/train/164670176_9f5b9c7965.jpg
call add_picture: 2059172936_032ffc12aa.jpg, length of file path 25
add picture success: ./test_picture/train/2059172936_032ffc12aa.jpg
call add_picture: 2093263381_afd51358a3.jpg, length of file path 25
add picture success: ./test_picture/train/2093263381_afd51358a3.jpg
call add_picture: 3203779656_3580151ea4_m.jpg, length of file path 27
add picture success: ./test_picture/train/3203779656_3580151ea4_m.jpg
call add_picture: 13920113_f03e867ea7_m.jpg, length of file path 25
add picture success: ./test_picture/train/13920113_f03e867ea7_m.jpg
call add_picture: 5794835_d15905c7c8_n.jpg, length of file path 24
add picture success: ./test_picture/train/5794835_d15905c7c8_n.jpg
call add_picture: 146023167_f905574d97_m.jpg, length of file path 26
add picture success: ./test_picture/train/146023167_f905574d97_m.jpg
call add_picture: 486234138_688e0_n.jpg, length of file path 21
add failed
call add_picture: 486234138_688e0_n.jpg, length of file path 21
call add_picture: 184682652_c927a49226_m.jpg, length of file path 26
add picture success: ./test_picture/train/184682652_c927a49226_m.jpg
call add_picture: 40410814_fba3837226_n.jpg, length of file path 25
add picture success: ./test_picture/train/40410814_fba3837226_n.jpg
call add_picture: 80846315_d997645bea_n.jpg, length of file path 25
add picture success: ./test_picture/train/80846315_d997645bea_n.jpg
call add_picture: 413815348_764ae83088.jpg, length of file path 24
add picture success: ./test_picture/train/413815348_764ae83088.jpg
call add_picture: 200557979_a16112aac1_n.jpg, length of file path 26
add picture success: ./test_picture/train/200557979_a16112aac1_n.jpg
call add_picture: 163978992_8128b49d3e_n.jpg, length of file path 26
add picture success: ./test_picture/train/163978992_8128b49d3e_n.jpg
call add_picture: 43474673_7bb4465a86.jpg, length of file path 23
add picture success: ./test_picture/train/43474673_7bb4465a86.jpg
call add_picture: 21652746_cc379e0eea_m.jpg, length of file path 25
add picture success: ./test_picture/train/21652746_cc379e0eea_m.jpg
call add_picture: 118974357_0faa23cce9_n.jpg, length of file path 26
add failed
call add_picture: 118974357_0faa23cce9_n.jpg, length of file path 26
call add_picture: 154332674_453cea64f4.jpg, length of file path 24
add picture success: ./test_picture/train/154332674_453cea64f4.jpg
call add_picture: 162362896_99c7d851c8_n.jpg, length of file path 26
add picture success: ./test_picture/train/162362896_99c7d851c8_n.jpg
call add_picture: 160456948_38c3817c6a_m.jpg, length of file path 26
add picture success: ./test_picture/train/160456948_38c3817c6a_m.jpg
call add_picture: 5794839_200acd910c_n.jpg, length of file path 24
add picture success: ./test_picture/train/5794839_200acd910c_n.jpg
call add_picture: 3179751458_9646d839f6_n.jpg, length of file path 27
add picture success: ./test_picture/train/3179751458_9646d839f6_n.jpg
call add_picture: 2183357362_4b4da4b6b5.jpg, length of file path 25
add picture success: ./test_picture/train/2183357362_4b4da4b6b5.jpg
call add_picture: 141652526_2be95f21c3_n.jpg, length of file path 26
add failed
call add_picture: 141652526_2be95f21c3_n.jpg, length of file path 26
call add_picture: 169371301_d9b91a2a42.jpg, length of file path 24
add picture success: ./test_picture/train/169371301_d9b91a2a42.jpg
call add_picture: 200288046_0032f322ff_n.jpg, length of file path 26
add picture success: ./test_picture/train/200288046_0032f322ff_n.jpg
call add_picture: 3450344423_63ba3190e3.jpg, length of file path 25
add failed
call add_picture: 3450344423_63ba3190e3.jpg, length of file path 25
call add_picture: 11405573_24a8a838cc_n.jpg, length of file path 25
add picture success: ./test_picture/train/11405573_24a8a838cc_n.jpg
call add_picture: 2141413229_3f0425f972_n.jpg, length of file path 27
add picture success: ./test_picture/train/2141413229_3f0425f972_n.jpg
call add_picture: 3554620445_082dd0bec4_n.jpg, length of file path 27
add failed
call add_picture: 3554620445_082dd0bec4_n.jpg, length of file path 27
call add_picture: 44079668_34dfee3da1_n.jpg, length of file path 25
add picture success: ./test_picture/train/44079668_34dfee3da1_n.jpg
call add_picture: 40411019_526f3fc8d9_m.jpg, length of file path 25
add picture success: ./test_picture/train/40411019_526f3fc8d9_m.jpg
call add_picture: 2609353769_dc3654f12f.jpg, length of file path 25
add picture success: ./test_picture/train/2609353769_dc3654f12f.jpg
call add_picture: 40410963_3ac280f23a_n.jpg, length of file path 25
add picture success: ./test_picture/train/40410963_3ac280f23a_n.jpg
[('40410814_fba3837226_n.jpg', 0.8202), ('40411019_526f3fc8d9_m.jpg', 0.7959), ('44079668_34dfee3da1_n.jpg', 0.7957), ('40410963_3ac280f23a_n.jpg', 0.7948), ('200288046_0032f322ff_n.jpg', 0.7419), ('184682652_c927a49226_m.jpg', 0.7291), ('5794839_200acd910c_n.jpg', 0.6738), ('163978992_8128b49d3e_n.jpg', 0.6732), ('200557977_bf24d9550b.jpg', 0.6675), ('134409839_71069a95d1_m.jpg', 0.6608)]
[('162362896_99c7d851c8_n.jpg', 0.9541), ('163978992_8128b49d3e_n.jpg', 0.9534), ('21652746_cc379e0eea_m.jpg', 0.93), ('413815348_764ae83088.jpg', 0.8996), ('5794835_d15905c7c8_n.jpg', 0.8991), ('5794839_200acd910c_n.jpg', 0.8933), ('134409839_71069a95d1_m.jpg', 0.8806), ('169371301_d9b91a2a42.jpg', 0.8272), ('43474673_7bb4465a86.jpg', 0.78), ('44079668_34dfee3da1_n.jpg', 0.7677)]
[('15987457_49dc11bf4b.jpg', 0.7605), ('151385301_153eacf6b5_n.jpg', 0.7571), ('80846315_d997645bea_n.jpg', 0.7416), ('11405573_24a8a838cc_n.jpg', 0.6828), ('146023167_f905574d97_m.jpg', 0.6674), ('13920113_f03e867ea7_m.jpg', 0.6639), ('160456948_38c3817c6a_m.jpg', 0.6396), ('510874382_f7e3435043.jpg', 0.6251)]
[('2141413229_3f0425f972_n.jpg', 1.0), ('2093263381_afd51358a3.jpg', 0.6334)]

演示程序会在华北-北京4自动创建名字为hwc_id_demo的图像搜索服务实例,将test_picture/train下的图片添加到实例中。

然后测试test_picture/test下图片作为搜索图片的搜索结果,在该Demo中过滤了相似度小于0.6的返回结果。

6 体验插件的魅力

华为云devkit已上线:Toolkit-华为云

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

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

相关文章

R5F5210BBDFB#10-ASEMI代理瑞萨芯片R5F5210BBDFB#10

编辑&#xff1a;ll R5F5210BBDFB#10-ASEMI代理瑞萨芯片R5F5210BBDFB#10 型号&#xff1a;R5F5210BBDFB#10 品牌&#xff1a;瑞萨&#xff08;Renesas) 封装&#xff1a;LFQFP-144 R5F5210BBDFB#10描述&#xff1a; R5F5210BBDFB#10具有1.62V至5.5V的宽工作电压范围&…

Linux内核4.14版本——drm框架分析(11)——DRM_IOCTL_MODE_ADDFB2(drm_mode_addfb2)

目录 1. drm_mode_addfb2 2. drm_internal_framebuffer_create 3. drm_fb_cma_create->drm_gem_fb_create->drm_gem_fb_create_with_funcs 4. drm_gem_fb_alloc 4.1 drm_helper_mode_fill_fb_struct 4.2 drm_framebuffer_init 5. 调用流程图 书接上回&#xff0c;使…

USB接口针式打印机

1 针式打印机原理 - 针式打印机16针是纵向排列&#xff0c;每次打印垂直的16bit&#xff0c;然后右移一bit&#xff0c;继续下列打印&#xff1b;字节的MSB表示最上面的点&#xff0c;字节LSB表示最下面的点 - 由于汉字字模的点阵是横向排列的&#xff0c;而提供给打印头的信息…

看板管理:以可视化方式确定任务优先级

确定工作的优先级是我们今天都要面对的挑战。若处理不当&#xff0c;我们就可能试图一心多用&#xff0c;从而严重损害工作效率。 使用看板方法来设定工作优先级是一种非常直观、快速的方法。 确定工作优先级的看板方法 看板工作流程管理方法的核心在于工作可视化。工作被划…

Docker基础入门

文章目录 前言一、什么是DockerDocker 安装Docker 镜像Docker 容器Docker 安装nginx 前言 在Linux上安装软件有三种方式&#xff1a; 在redhat系列下的发行版通过rpm包安装或者是在debian系列下的发行版通过deb包安装&#xff1b;通过工具安装&#xff0c;在redhat系列下的发…

Mybatis中动态SQL标签和内置参数介绍

Mybatis中动态SQL标签和内置参数 一、MyBatis动态SQL 1.1、sql标签 sql标签用于抽取公用的SQL代码&#xff0c;定义sql标签的时候需要通过【id】属性设置唯一标识。 <?xml version"1.0" encoding"UTF-8" ?> <!DOCTYPE mapperPUBLIC "-…

【FAQ】视频监控管理平台/视频汇聚平台EasyCVR安全检查相关问题及解决方法3.0

智能视频监控系统/视频云存储/集中存储/视频汇聚平台EasyCVR具备视频融合汇聚能力&#xff0c;作为安防视频监控综合管理平台&#xff0c;它支持多协议接入、多格式视频流分发&#xff0c;视频监控综合管理平台EasyCVR支持海量视频汇聚管理&#xff0c;可应用在多样化的场景上&…

DHT11 温湿度传感器

目录 1.DHT11 温湿度传感器概述 2.检测DHT11温湿度传感器模块是否存在 3.通过编写代码读取温湿度数据​编辑 4.将读取到的温湿度数据通过串口上传 1.DHT11 温湿度传感器概述 DHT11数字温湿度传感器是一款含有已校准数字信号输出的温湿度复合传感器&#xff0c;应用领域&am…

【资源推荐】一站式机器学习学习资料

我之前向大家推荐了许多关于人工智能数学原理与应用的资料&#xff0c;其中包括线性代数、机器学习和深度学习等方面的内容。 交互式线性代数学习网站 沉浸式线性代数学习网站 Kaggle大神教你机器学习 今天我将继续向大家推荐一个一站式学习机器学习的绝佳资源&#xff1a;《…

《TCP/IP网络编程》阅读笔记--多线程服务器端的实现

1--多线程的优点 多进程服务器的缺点&#xff1a; ① 创建进程的过程会带来一定的开销&#xff1b; ② 为了完成进程间的数据交换&#xff0c;需要特殊的 IPC 技术&#xff1b; ③ 进程间的上下文切换是创建进程时的最大开销&#xff1b; 多线程的优点&#xff1a; ① 线程的创…

C#类与类库调用注意事项

类 创建一个类文件&#xff0c;myfunction.cs //静态类&#xff1a;直接引用、无需实例化 static public int jiafa(int V) //普通类&#xff1a;引用时需要实例化 public int jiafa(int V)using System; using System.Collections.Generic; using System.Diagnostics; using …

无涯教程-JavaScript - ISNA函数

描述 如果指定的值为Excel&#xff03;N/A错误值,或者表达式返回Excel&#xff03;N/A错误,则ISNA函数将返回逻辑值TRUE。否则返回FALSE。当值不可用于您的公式时,将发生Excel&#xff03;N/A错误。 语法 ISNA (value)争论 Argument描述Required/OptionalvalueValue or exp…

《算法竞赛·快冲300题》每日一题:“点灯游戏”

《算法竞赛快冲300题》将于2024年出版&#xff0c;是《算法竞赛》的辅助练习册。 所有题目放在自建的OJ New Online Judge。 用C/C、Java、Python三种语言给出代码&#xff0c;以中低档题为主&#xff0c;适合入门、进阶。 文章目录 题目描述题解C代码Java代码Python代码 “ 点…

vue cli 打包、生产环境http-proxy-middleware代理

结构树 版本 1、创建vue.config.js const path require(path); const UglifyJsPlugin require(uglifyjs-webpack-plugin) //压缩 const CompressionWebpackPlugin require(compression-webpack-plugin) const isProduction process.env.NODE_ENV ! development;module.exp…

请求与响应以及REST风格

目录 请求与响应请求参数参数传递 五种类型参数传递普通参数POJO数据类型嵌套POJO类型参数数组类型参数集合类型参数 JSON数据传输参数JSON普通数组JSON对象数据JSON对象数组知识点1&#xff1a;EnableWebMvc知识点2&#xff1a;RequestBodyRequestBody与RequestParam区别日期类…

[SICTF 2023] webmisc

文章目录 webBaby_PHP涉及知识点 我全都要RCE你能跟得上我的speed吗 miscPixel_art攻破这个压缩包&#xff01; web Baby_PHP 涉及知识点 php解析特性apache换行解析漏洞无参RCE 源代码 <?php highlight_file(__FILE__); error_reporting(0);$query $_SERVER[QUERY_ST…

OpenCV Series : Target Box Outline Border

角点 P1 (255, 000, 000) P2 (000, 255, 000) P3 (000, 000, 255) P4 (000, 000, 000)垂直矩形框 rect cv2.minAreaRect(cnt)targetColor roi_colortargetThickness 1targetColor (255, 255, 255)if lineVerbose:if True:cv2.line(ph…

做机器视觉工程师,其实挺没意思的

3.康耐视VisionPro高级脚本系列教程-3.脚本编辑错误和运行错误调试方法&#xff0c;break和Contitinuee的差别_哔哩哔哩_bilibili 其实人生就是“有时有意思&#xff0c;有时没意思”。 心里有太多的不甘心&#xff0c;太多的苦水&#xff0c;是没法再吃学习的苦&#xff0c…

市场调查中的信度和效度分析原理及python实现示例

市场调查中的信度和效度分析 1.量表信度分析1.1 内部一致性信度&#xff1a;克朗巴赫α系数原理1.2 python实现示例 2.量表效度分析2.1 内容效度2.1.1 原理2.1.2 python实现示例 2.2 准则效度2.2.1 原理2.2.2 python实现示例 2.3 结构效度2.3.1 原理2.3.2 python实现示例 3.量表…

[PyTorch][chapter 54][GAN- 1]

前言&#xff1a; GAN playground: Experiment with Generative Adversarial Networks in your browser 生成对抗网络&#xff08;Generative Adversarial Nets&#xff0c;GAN&#xff09;是一种基于对抗学习的深度生成模型&#xff0c;最早由Ian Goodfellow于2014年在《Gener…