Commit f3f2f299 authored by Bucky Lee's avatar Bucky Lee
Browse files

feat: update

parent 7b44bee2
Loading
Loading
Loading
Loading
+5 −11
Original line number Diff line number Diff line
@@ -34,23 +34,17 @@ def allowed_file(filename):


@app.route('/upload', methods=['GET', 'POST'])
def upload_file():
def upload_file(model_name):
    file = request.files['file']
    print(datetime.datetime.now(), file.filename)
    if file and allowed_file(file.filename):
        src_path = os.path.join(app.config['UPLOAD_FOLDER'], file.filename)
        file.save(src_path)
        # shutil.copy(src_path, './tmp/ct')
        # image_path = os.path.join('./tmp/ct', file.filename)
        # print(image_path)
        # pid, image_info = core.main.c_main(image_path, current_app.model)
        # return jsonify({'status': 1,
        #                 'image_url': 'http://127.0.0.1:5003/tmp/image/' + pid,
        #                 'draw_url': 'http://127.0.0.1:5003/tmp/draw/' + pid,
        #                 'image_info': image_info
        #                 })

        image_path = os.path.join('data/unprocessed', file.filename)
        if core.main.process(image_path, model_name):
            return 'Success!'
    return 'Failed!'


# show photo
+5 −0
Original line number Diff line number Diff line
from core import predict, process

def process(file_path, model_name):
    # TODO: fill this
    return 'Success'


if __name__ == '__main__':
    pass
 No newline at end of file
+0 −19
Original line number Diff line number Diff line
@@ -7,25 +7,6 @@ declare module '@vue/runtime-core' {
  export interface GlobalComponents {
    BaseHeader: typeof import('./components/layouts/BaseHeader.vue')['default']
    BaseSide: typeof import('./components/layouts/BaseSide.vue')['default']
    ElAside: typeof import('element-plus/es')['ElAside']
    ElButton: typeof import('element-plus/es')['ElButton']
    ElCard: typeof import('element-plus/es')['ElCard']
    ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
    ElContainer: typeof import('element-plus/es')['ElContainer']
    ElDialog: typeof import('element-plus/es')['ElDialog']
    ElHeader: typeof import('element-plus/es')['ElHeader']
    ElIcon: typeof import('element-plus/es')['ElIcon']
    ElImage: typeof import('element-plus/es')['ElImage']
    ElMain: typeof import('element-plus/es')['ElMain']
    ElMenu: typeof import('element-plus/es')['ElMenu']
    ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
    ElOption: typeof import('element-plus/es')['ElOption']
    ElSelect: typeof import('element-plus/es')['ElSelect']
    ElStep: typeof import('element-plus/es')['ElStep']
    ElSteps: typeof import('element-plus/es')['ElSteps']
    ElTable: typeof import('element-plus/es')['ElTable']
    ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
    ElUpload: typeof import('element-plus/es')['ElUpload']
    HelloWorld: typeof import('./components/HelloWorld.vue')['default']
    Image_upload: typeof import('./components/image_upload.vue')['default']
    Info: typeof import('./components/info.vue')['default']