PicImageSearch帮助文档
# PicImageSearch
整合图片识别api,用于以图搜源(以图搜图,以图搜番)
支持SauceNAO,tracemoe,iqdb,ascii2d,google(谷歌识图),baidu(百度识图)等
(opens new window)
⚠️注意
帮助文档看左侧目录列表
若有改进建议欢迎底下评论
# 支持以下搜图网站
SauceNAO
SauceNAO Reverse Image Search
TraceMoe
Anime Scene Search by Image
Ascii2D
二次元画像詳細検索
Iqdb
Multi-service image search
Google谷歌识图
国外神器
BaiDu百度识图
百度 已死
E-hentai/Exhentai
E绅士
- name: SauceNAO
desc: 'SauceNAO Reverse Image Search'
avatar: https://z3.ax1x.com/2021/03/21/64BclV.png
link: https://saucenao.com # 可选
bgColor: '#FFFFFF' # 可选,默认var(--bodyBg)。颜色值有#号时请添加单引号
textColor: '#6854A1' # 可选,默认var(--textColor)
- name: TraceMoe
desc: 'Anime Scene Search by Image'
avatar: https://z3.ax1x.com/2021/03/21/64B6S0.png
link: https://trace.moe
bgColor: '#718971'
textColor: '#fff'
- name: Ascii2D
desc: '二次元画像詳細検索'
avatar: https://z3.ax1x.com/2021/03/21/64BgyT.png
link: https://ascii2d.net
bgColor: '#40394a'
textColor: '#7eca9c'
- name: Iqdb
desc: 'Multi-service image search'
avatar: https://z3.ax1x.com/2021/03/21/64BWmF.png
link: http://www.iqdb.org
bgColor: '#f39189'
textColor: '#046582'
- name: Google谷歌识图
desc: '国外神器'
avatar: https://z3.ax1x.com/2021/03/21/64Bfw4.jpg
link: https://www.google.com/imghp
bgColor: '#caf7e3'
textColor: '#7868e6'
- name: BaiDu百度识图
desc: '百度 已死'
avatar: https://z3.ax1x.com/2021/03/21/64B2OU.jpg
link: https://graph.baidu.com
bgColor: '#edeef7'
textColor: '#7868e6'
- name: E-hentai/Exhentai
desc: 'E绅士'
avatar: https://pic2.zhimg.com/v2-17efcdb7f1eb08b53bba4cddf93a043a_1440w.jpg
link: https://e-hentai.org
bgColor: '#5b383f'
textColor: '#fff'
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
建议❤️
非常建议直接使用异步进行开发
同步为异步的魔改版本
(opens new window) 来自: telethon/sync
Bug🐛
同步情况下,IDE将无法识别返回值,也就是无法出现类型提示.
提示✨
本项目结构简单,大佬请直接看源码
# 异步快速开始👾
from PicImageSearch import Network, SauceNAO
from PicImageSearch.model import SauceNAOResponse
# proxies = "http://127.0.0.1:1081"
proxies = None
# url = "https://raw.githubusercontent.com/kitUIN/PicImageSearch/main/demo/images/test01.jpg"
url = r"images/test01.jpg" # 搜索本地图片
api_key = "" # SauceNao API KEY
async with Network(proxies=proxies) as client:
saucenao = SauceNAO(client=client, api_key=api_key)
resp = await saucenao.search(url)
2
3
4
5
6
7
8
9
10
11
12
注意事项
若是网络不好,则需要使用 魔法上网 访问SauceNAO (opens new window)
必须使用api_key
➡️前去申请 (opens new window)
from PicImageSearch import Network, TraceMoe
from PicImageSearch.model import TraceMoeResponse
# proxies = "http://127.0.0.1:10809"
proxies = None
# url = "https://raw.githubusercontent.com/kitUIN/PicImageSearch/main/demo/images/test05.jpg"
url = r"images/test05.jpg" # 搜索本地图片
async with Network(proxies=proxies) as client:
tracemoe = TraceMoe(client=client, mute=False, size=None)
resp = await tracemoe.search(url)
2
3
4
5
6
7
8
9
10
11
from PicImageSearch import Ascii2D, Network
from PicImageSearch.model import Ascii2DResponse
# proxies = "http://127.0.0.1:1081"
proxies = None
# url = "https://raw.githubusercontent.com/kitUIN/PicImageSearch/main/demo/images/test01.jpg"
url = r"images/test01.jpg" # 搜索本地图片
bovw = True # 是否使用特征检索
async with Network(proxies=proxies) as client:
ascii2d = Ascii2D(client=client, bovw=bovw)
resp = await ascii2d.search(url)
2
3
4
5
6
7
8
9
10
11
12
注意事项
不建议使用res.raw[0]
,因为其内容可能是空的
判空可用代码if res.raw[0].url == "":
建议从res.raw[1]
开始使用
from PicImageSearch import Iqdb, Network
from PicImageSearch.model import IqdbResponse
# proxies = "http://127.0.0.1:1081"
proxies = None
# url = "https://raw.githubusercontent.com/kitUIN/PicImageSearch/main/demo/images/test01.jpg"
url = r"images/test01.jpg" # 搜索本地图片
async with Network(proxies=proxies) as client:
iqdb = Iqdb(client=client)
resp = await iqdb.search(url)
# resp = await iqdb.search_3d(url) # 3D搜索
2
3
4
5
6
7
8
9
10
11
12
from PicImageSearch import Google, Network
from PicImageSearch.model import GoogleResponse
proxies = "http://127.0.0.1:1081"
# proxies = None
# url = "https://raw.githubusercontent.com/kitUIN/PicImageSearch/main/demo/images/test03.jpg"
url = r"images/test03.jpg" # 搜索本地图片
async with Network(proxies=proxies) as client:
google = Google(client=client)
resp = await google.search(url) # 第一页
resp2 = await google.goto_page(resp.get_page_url(2), 2) # 第二页
2
3
4
5
6
7
8
9
10
11
12
注意事项
不建议使用res.raw[0]
res.raw[1]
,因为其内容可能是空的
建议从res.raw[2]
开始使用
from PicImageSearch import BaiDu, Network
from PicImageSearch.model import BaiDuResponse
# proxies = "http://127.0.0.1:1081"
proxies = None
# url = "https://raw.githubusercontent.com/kitUIN/PicImageSearch/main/demo/images/test02.jpg"
url = r"images/test02.jpg" # 搜索本地图片
async with Network(proxies=proxies) as client:
baidu = BaiDu(client=client)
resp = await baidu.search(url)
2
3
4
5
6
7
8
9
10
11
12
from PicImageSearch import EHentai, Network
from PicImageSearch.model import EHentaiResponse
# proxies = "http://127.0.0.1:10809"
proxies = None
file_path = r"images/test06.jpg" # 搜索本地图片
cookies = None
# 注意:如果要使用 EXHentai 搜索,需要提供 cookies(ipb_member_id与ipb_pass_hash为必须)
ex = False # 是否使用 EXHentai 搜索
async with Network(proxies=proxies, cookies=cookies) as client:
ehentai = EHentai(client=client)
resp = await ehentai.search(file_path, ex=ex)
2
3
4
5
6
7
8
9
10
11
12
13
14
// Make sure to add code blocks to your code group
# 同步快速开始🎃
from PicImageSearch.sync import SauceNAO
from PicImageSearch.model import SauceNAOResponse
# proxies = "http://127.0.0.1:1081"
proxies = None
# url = "https://raw.githubusercontent.com/kitUIN/PicImageSearch/main/demo/images/test01.jpg"
url = r"images/test01.jpg" # 搜索本地图片
api_key = "" # SauceNao API KEY
saucenao = SauceNAO(api_key=api_key)
resp = await saucenao.search(url)
2
3
4
5
6
7
8
9
10
11
12
注意事项
若是网络不好,则需要使用 魔法上网 访问SauceNAO (opens new window)
必须使用api_key
➡️前去申请 (opens new window)
from PicImageSearch.sync import TraceMoe
from PicImageSearch.model import TraceMoeResponse
# proxies = "http://127.0.0.1:10809"
proxies = None
# url = "https://raw.githubusercontent.com/kitUIN/PicImageSearch/main/demo/images/test05.jpg"
url = r"images/test05.jpg" # 搜索本地图片
tracemoe = TraceMoe(mute=False, size=None)
resp = tracemoe.search(url)
2
3
4
5
6
7
8
9
10
from PicImageSearch.sync import Ascii2D
from PicImageSearch.model import Ascii2DResponse
# proxies = "http://127.0.0.1:1081"
proxies = None
# url = "https://raw.githubusercontent.com/kitUIN/PicImageSearch/main/demo/images/test01.jpg"
url = r"images/test01.jpg" # 搜索本地图片
bovw = True # 是否使用特征检索
ascii2d = Ascii2D(bovw=bovw)
resp = ascii2d.search(url)
2
3
4
5
6
7
8
9
10
11
12
注意事项
不建议使用res.raw[0]
,因为其内容可能是空的
判空可用代码if res.raw[0].url == "":
建议从res.raw[1]
开始使用
from PicImageSearch.sync import Iqdb
from PicImageSearch.model import IqdbResponse
# proxies = "http://127.0.0.1:1081"
proxies = None
# url = "https://raw.githubusercontent.com/kitUIN/PicImageSearch/main/demo/images/test01.jpg"
url = r"images/test01.jpg" # 搜索本地图片
iqdb = Iqdb()
resp = iqdb.search(url)
# resp = iqdb.search_3d(url) # 3D搜索
2
3
4
5
6
7
8
9
10
11
12
from PicImageSearch.sync import Google
from PicImageSearch.model import GoogleResponse
proxies = "http://127.0.0.1:1081"
# proxies = None
# url = "https://raw.githubusercontent.com/kitUIN/PicImageSearch/main/demo/images/test03.jpg"
url = r"images/test03.jpg" # 搜索本地图片
google = Google()
resp = google.search(url) # 第一页
resp2 = google.goto_page(resp.get_page_url(2), 2) # 第二页
2
3
4
5
6
7
8
9
10
11
12
注意事项
不建议使用res.raw[0]
res.raw[1]
,因为其内容可能是空的
建议从res.raw[2]
开始使用
from PicImageSearch.sync import BaiDu
from PicImageSearch.model import BaiDuResponse
# proxies = "http://127.0.0.1:1081"
proxies = None
# url = "https://raw.githubusercontent.com/kitUIN/PicImageSearch/main/demo/images/test02.jpg"
url = r"images/test02.jpg" # 搜索本地图片
baidu = BaiDu()
resp = baidu.search(url)
2
3
4
5
6
7
8
9
10
11
from PicImageSearch.sync import EHentai
from PicImageSearch.model import EHentaiResponse
# proxies = "http://127.0.0.1:10809"
proxies = None
file_path = r"images/test06.jpg" # 搜索本地图片
cookies = None
# 注意:如果要使用 EXHentai 搜索,需要提供 cookies(ipb_member_id与ipb_pass_hash为必须)
ex = False # 是否使用 EXHentai 搜索
ehentai = EHentai()
resp = ehentai.search(file_path, ex=ex)
2
3
4
5
6
7
8
9
10
11
12
13
// Make sure to add code blocks to your code group
# 发展历程📖
# 起始👀
是发现了众多的搜图引擎,想要部署在一个ioo/opq
(opens new window) 机器人平台上,以此实现QQ机器人的识图功能,但是发现都是散件
API,所以就萌发了整合一个的想法.
# 发展⛏️
接触了nonebot2
(opens new window) 平台后,一位佬加入了该项目中👉Neko Aria
(opens new window)
并且上来就是大重构,所以现在该项目已经是他的形状了(这就是牛头人吗?)