请问有人可以帮忙吗?我已经搜索了网络,显然是 Stackoverflow,但我仍然遇到看起来很容易解决但实际上不是(无论如何对我来说)的错误创建这样的项目。请原谅我的评论!:)
%matplotlib inline
from matplotlib.pyplot import imshow
from PIL import Image
import requests
from io import BytesIO
import numpy as np
import imageio
import matplotlib.pyplot as plt
from PIL import Image
im1 = imageio.imread('DM.jpg') #Read the image from the desktop
# print(im1.shape) #Returns the number of rows, columns and channels (if image is colour returns "3")
#plt.imshow(im1)
#plt.show() !!!This works.Take away the hash tag and it will show the image!!!
#New script to try a face recognition
faceURI = "https://*****************azure.com/"
faceKey = "*********************"
import cognitive_face as CF
# Set URI and Key
CF.BaseUrl.set(faceURI)
CF.Key.set(faceKey)
# Detect faces in an image
img_url = 'DM.jpg'
result = CF.face.detect(img_url)
print (result)
所以我现在相信我哪里出错了?它在代码中关于端点和密钥的部分不应该在那里,而是在 bash 文件中。现在这就是我现在遇到麻烦的地方!哈哈(不下雨但倾盆大雨!)。我正在尝试使用 vim,但这是新事物,现在我自己也在努力解决 *facepalms