예제 #1
0
def upload_file():
    if request.method == 'POST':
        file = request.files['file']
        if file and allowed_file(file.filename):
            filename = secure_filename(file.filename)
            file.save(filename)
            crop_face.faceCrop(filename)
            fname, ext = os.path.splitext(filename)
            return query.queryModel(fname + '_cropped' + ext)
            #return "File uploaded" #redirect(url_for('uploaded_file',
            #filename=filename))
    return render_template('upload.html')
def upload_file():
    if request.method == 'POST':
        file = request.files['file']
        if file and allowed_file(file.filename):
            filename = secure_filename(file.filename)
            file.save(filename)
            crop_face.faceCrop(filename)
            fname,ext = os.path.splitext(filename)
            return query.queryModel(fname+'_cropped'+ext)
            #return "File uploaded" #redirect(url_for('uploaded_file',
                                    #filename=filename))
    return render_template('upload.html')   
예제 #3
0
def down():
    link = request.args.get('url')
    urllib.urlretrieve(link, os.path.basename(link))
    crop_face.faceCrop(os.path.basename(link))
    fname, ext = os.path.splitext(os.path.basename(link))
    return query.queryModel(fname + '_cropped' + ext)
def down():
    link=request.args.get('url')
    urllib.urlretrieve(link, os.path.basename(link))
    crop_face.faceCrop(os.path.basename(link))
    fname,ext = os.path.splitext(os.path.basename(link))
    return query.queryModel(fname+'_cropped'+ext)