使用请求包调用下面的 REST API 的 python 代码应该是什么?我不知道如何通过“apikey”
curl -X POST -u "apikey":"1234abcd" -H "Accept: application/json" -F "file=@{input_file}" https://api_url
Run Code Online (Sandbox Code Playgroud)
感谢您的帮助。
我local_binary_pattern在scikit-image包中使用该函数.我想计算半径为1的8个邻居的旋转不变均匀LBP.这是我的Python代码:
import numpy as np
from skimage.feature import local_binary_pattern
image = np.array([[150, 137, 137, 146, 146, 148],
[145, 144, 144, 144, 142, 144],
[149, 144, 144, 143, 153, 147],
[145, 144, 147, 150, 145, 150],
[146, 146, 139, 148, 144, 148],
[129, 139, 142, 150, 146, 140]]).astype(np.uint8)
lbp = local_binary_pattern(image, 8, 1, "uniform")
print("image =")
print(image)
print("lbp =")
print(lbp)
Run Code Online (Sandbox Code Playgroud)
这是输出
image =
[[150 137 137 146 146 148]
[145 144 144 144 142 144]
[149 144 144 143 …Run Code Online (Sandbox Code Playgroud)