"""
This script runs the python_webapp_flask application using a development server.
"""

from os import environ
from python_webapp_flask import app

if __name__ == '__main__':
    app.run(host='127.0.0.1')
Пример #2
0
"""
This script runs the python_webapp_flask application using a development server.
"""

from os import environ
from python_webapp_flask import app

if __name__ == '__main__':
    app.secret_key = 'super secret key'
    app.config['SESSION_TYPE'] = 'filesystem'
    #app.run(host='127.0.0.1' debug=True) # localhost
    app.run(host='0.0.0.0', debug=True)
Пример #3
0
"""
This script runs the python_webapp_flask application using a development server.
"""

from os import environ
from python_webapp_flask import app

if __name__ == '__main__':
    HOST = environ.get('SERVER_HOST', '0.0.0.0')
    try:
        PORT = int(environ.get('SERVER_PORT', '5555'))
    except ValueError:
        PORT = 5555
    app.run(HOST, PORT)
Пример #4
0
    diff = (diff * 255).astype("uint8")
    print("SSIM: {}".format(score))

    # threshold the difference image, followed by finding contours to
    # obtain the regions of the two input images that differ
    thresh = cv2.threshold(diff, 0, 255,
                           cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1]
    cnts = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL,
                            cv2.CHAIN_APPROX_SIMPLE)
    cnts = cnts[0] if imutils.is_cv2() else cnts[1]

    # loop over the contours
    for c in cnts:
        # compute the bounding box of the contour and then draw the
        # bounding box on both input images to represent where the two
        # images differ
        (x, y, w, h) = cv2.boundingRect(c)
        cv2.rectangle(imageA, (x, y), (x + w, y + h), (0, 0, 255), 2)
        cv2.rectangle(imageB, (x, y), (x + w, y + h), (0, 0, 255), 2)
        # show the output images
        cv2.imwrite(os.path.join(app.config['UPLOAD_FOLDER'], "Diff.jpg"),
                    imageB)
        cv2.imwrite(
            os.path.join(app.config['UPLOAD_FOLDER'], "Actual_Diff.jpg"), diff)
        cv2.imwrite(os.path.join(app.config['UPLOAD_FOLDER'], "Thresh.jpg"),
                    thresh)


if __name__ == '__main__':
    app.run(debug=True)
Пример #5
0
"""
This script runs the python_webapp_flask application using a development server.
"""

from os import environ
import os
from python_webapp_flask import app # import app
from flask import jsonify


@app.route('/first_endpoint', methods=["GET"])
def test_function():
    print("let's get WHACK going!")
    print(os.environ["secret"])
    return jsonify(name=f"hey")

if __name__ == '__main__':
    app.run(host = "localhost", port=5555, debug=True)
Пример #6
0
"""
This script runs the python_webapp_flask application using a development server.
"""

from os import environ
from python_webapp_flask import app

if __name__ == '__main__':
    app.run(host='0.0.0.0')