html调用api接口json_网址权重查询 API 接口请求调用

站长之家权重查询 API 接口在网上已经很多且大都封装成了 API 供别人调用。支持前台跨域请求,以GET/POST方式提交即可。站长之家权重查询 API 接口可以查询百度权重、360权重、神马权重等,你可以选择调用本站的接口,也可以利用本站的 API 接口封装成自己的接口。

cca9b1c0c166037c2e8f12a1ce825c7d.png

#站长之家权重查询API请求方式 #

Method: GET/POST

# 请求地址 #

https://api.ooopn.com/rank/chinaz/api.php

# 请求参数 #

url //要查询的域名,不带http/https(必填)

img //bdpc-bdm-360pc-360m-sm,返回权重图片(选填)

# 返回参数 #

code //状态码,200-查询成功,201-没填写域名

domain //要查询的域名

bdpc //百度权重

bdm //百度移动权重

360pc //360权重

360m //360移动权重

sm //神马权重

msg //错误状态

# 调用示例 #

https://api.ooopn.com/rank/chinaz/api.php?url=www.qq.com

https://api.ooopn.com/rank/chinaz/api.php?url=www.qq.com&img=bdpc

# 返回数据 #

{

"code": "200

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这是对单个文件进行预测“import os import json import torch from PIL import Image from torchvision import transforms import matplotlib.pyplot as plt from model import convnext_tiny as create_model def main(): device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") print(f"using {device} device.") num_classes = 5 img_size = 224 data_transform = transforms.Compose( [transforms.Resize(int(img_size * 1.14)), transforms.CenterCrop(img_size), transforms.ToTensor(), transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])]) # load image img_path = "../tulip.jpg" assert os.path.exists(img_path), "file: '{}' dose not exist.".format(img_path) img = Image.open(img_path) plt.imshow(img) # [N, C, H, W] img = data_transform(img) # expand batch dimension img = torch.unsqueeze(img, dim=0) # read class_indict json_path = './class_indices.json' assert os.path.exists(json_path), "file: '{}' dose not exist.".format(json_path) with open(json_path, "r") as f: class_indict = json.load(f) # create model model = create_model(num_classes=num_classes).to(device) # load model weights model_weight_path = "./weights/best_model.pth" model.load_state_dict(torch.load(model_weight_path, map_location=device)) model.eval() with torch.no_grad(): # predict class output = torch.squeeze(model(img.to(device))).cpu() predict = torch.softmax(output, dim=0) predict_cla = torch.argmax(predict).numpy() print_res = "class: {} prob: {:.3}".format(class_indict[str(predict_cla)], predict[predict_cla].numpy()) plt.title(print_res) for i in range(len(predict)): print("class: {:10} prob: {:.3}".format(class_indict[str(i)], predict[i].numpy())) plt.show() if __name__ == '__main__': main()”,改为对指定文件夹下的左右文件进行预测,并绘制混淆矩阵
06-11

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值