手寫數字圖片辨識 API

此API提供28*28像素圖片的影像數字辨識。使用者透過POST將照片檔案或base64編碼圖片傳入,即可得到此圖片的數字預測結果。

Heroku 測試 API:
API
備用API

mnist

上傳圖片預測

POST /mnist

Body參數 類型 傳輸格式 描述
image(必填) File FormData 上傳圖片

測試圖片可以來這裡下載,若要放自己的次是圖片記得要1:1正方形的圖檔(最好28*28像素)

Request
Content-Type: application/json

Success 200

Response
Content-Type: application/json

{ image: "iVBORw0KGgoAAAANSUhEUgAAAIwAAACMCAYAAACuwEE+AAAIiUlEQVR4Xu2dS8hVVRTH/3+zBxU9yAZZkD0GCgZBWE4igx7DbBaNqklFhpVhWYqKloZGEUUNohxEDbVZFEE1qSwoSA0HWkFCkD3sQZmPFVv2xU/97r1773PWueess+5Q115nr//6fft99iH85wpkKMAMWzd1BeDAOARZCjgwWXK5sQPjDGQp4MBkyeXGDowzkKWAA5Mllxv3EhgReRnAgwBmjEDgLwCrSL7omBxXwDwwIvIIgHUAzq2QeIcnimcOGBHZCOChioAMY+sogGV9bnVMACMic0IiATwAYGaFliS16E8kL0k1tmTXSWBiN/M0gFkTTMZhkqdP8PkTeXSngBGRCwB8CmDuRNSa/qGP9qmL6gQwsctZCeAeAKe1CJZBVT4muaiF9aq9Sq0GJg5g7wcQWpa2/3rR0rQSGBEJLckLHQFlALKQHLWu03bgk+rXKmBii7IUwFlJtW+f0Sskl7SvWvXVqBXAxFnPpoamxCer9y+AFfEfN1SE1XwrM3FgRGQXgHn1/Q2M9HQAwJqUWY2IbAWwuKBeH5K8paBcJ4pMDJg4Rd4JYLaSUgGO10g+WcW/iBwumJmZnTU1DkzsftYDOKdKIoeUDZC8BWAzye/r8i8i/wHIXaQzOWtqFBgR+QzADXUlMvrZAeBGkr/X7PcEdwXQ/E2yyoanZjjFvhsDRkS2A1hQXNNTC/4CYH3KeKSuZ4pI2HxM1oxksm1dddT200hAIvIjgEtrCOYggNfr7nJS6xWn/U+k2jswqUpNsRORn2vYJPwNwGMktxRUodY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/mnist

Body參數 類型 傳輸格式 描述
image(必填) string JSON 圖片base64編碼

Request
Content-Type: application/json

{ image:"iVBORw0KGgoAAAANSUhEUgAAAIwAAACMCAYAAACuwEE+AAAIf0lEQVR4Xu2dS89eUxTH/8stiqjbiLgFCYMmJsLM1LAmBvUBWjRRWpSQNCFUtGpQyhcgTFpDs8YIMyISSYVKmJBWQ4Nou2TXfl9P38vzrLXPOvvsy3qn79rr7P1fv2ft69mH4H+ugEIBUti6qSsAB8YhUCngwKjkcmMHxhlQKeDAqORyYwfGGVAp4MCo5NIZM/P7AB4BcPGKkmcBvEtE23Uep7d2YAxjwMx7AWwFcI3Q7XEiuk1oW4SZA2MQhgjKTgCXJLh7u6ZM48AkRDgUYeaQGQIk2xJBWXryWSJKAS2x5sOKOTBK/RK6nYVPIKJq4lBNRReqPrLBwG5nbu0cmJGDl9P9mKDEdniXlDOgYzzLcHwiqZ4PeiUqlWgzxvhkQTt9Wl0iCIvqxMw7ALwxcLaz6DGz/z8H4FBN0+mlync/6GXmzwDcr4l2gm1Y2f2IiLYklC2qSLfAjJxVzgDYT0S7i4q2QWW6BGbErHIq7hE1B0q3XRIzfwHgPoMf25KLkE3eA7CPiH4w9Fukq64yDDMfB3CLUSSa7Xbm6dMFMHG8sh/ARQawdAlKN10SMx8F8KABKM2PTyQaNZ1hmPkwgM0SIdaxOX/QqZfxiUSnZoExmAl9TUSbJCL2ZNMkMAYzoc+J6IGeQJC2tTlgBmaWMKB9hojekgrYm11TwMTZ0IHEIB4jorsSy3ZTrDVgTgO4IiF6XxLRvQnluivSDDDMHE7qn0yI4BEiejihXJdFWgLmJwA3KqP4CRE9pCzTtXkTwDDzNwDuUUQyrK/s8sGtQrFoWj0wCQPdM0R0qV4qLxEUaAGYMBVe+SrqvOg+5ZklHf6qgUnILt8S0d3pcnnJ2oH5DcBGYRjDOdrriSiU8b9EBaoFJr4K8r2i3S8R0SsKezddQ4GagfkFwA3SqNb0dqG0TVPYVQlMwjT6FBFJr+CYIg7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