Hi everyone,
I am following along this great book, now I am at the end of Chapter 6. I decided to add an upload button to upload arbitrary pictures (people’s faces) in order to get predictions regarding the center of faces.
btn_upload = widgets.FileUpload()
img = PILImage.create(btn_upload.data[-1])
result = learn.predict(img)
I get something like this:
(TensorPoint([[185.7335, 116.8725]]),
tensor([ 0.1608, -0.0261]),
tensor([ 0.1608, -0.0261]))
How can I plot these coordinates on the uploaded picture (a red dot)?
Below what I tried but:
1, it clearly shows the wrong location.
2, I suspect fastai has a proper way of doing it.
implot = plt.imshow(img)
plt.scatter(result[0][0][0], result[0][0][1])
plt.show()
Many thanks
Peter Rusznak