This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<input type='file' onchange="resnetPredict(this);" /> | |
</body> | |
<script> | |
function resnetPredict(input) { | |
if (input.files && input.files[0]) { | |
$('#images_show').show(); | |
var reader = new FileReader(); | |
reader.onload = function (e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# importing all required package library | |
from keras.applications import ResNet50 | |
from keras.preprocessing.image import img_to_array | |
from keras.applications import imagenet_utils | |
import numpy as np | |
# A class for image prediction based on ResNet pre-trained model | |
class ResNetPredict: | |
def __init__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# importing all required library | |
import flask | |
import io | |
from flask_cors import CORS | |
from PIL import Image | |
from ResNetPredict import ResNetPredict | |
app = flask.Flask(__name__) | |
# Cross Origin Resource Sharing (CORS), making the URL accessible from cross-origin AJAX |