@@ -76,10 +76,8 @@ def get_image(file: UploadFile = File(...)) -> JSONResponse:
7676 # 画像のファイル名の取得
7777 file_name = file .filename
7878
79- # プロジェクトルートディレクトリのパスを取得(3階層上に移動)
80- project_root = os .path .dirname (os .path .dirname (os .path .dirname (__file__ )))
8179 # 画像保存用ディレクトリのパスを設定
82- image_data_dir = os .path .join (project_root , 'image_data' )
80+ image_data_dir = os .path .join ('image_data' )
8381
8482 # image_dataディレクトリが存在しない場合は作成
8583 os .makedirs (image_data_dir , exist_ok = True )
@@ -119,7 +117,7 @@ def get_image(file: UploadFile = File(...)) -> JSONResponse:
119117 )
120118
121119
122- @app .post ("/minifig/upload " , response_class = JSONResponse )
120+ @app .post ("/minifig/detect " , response_class = JSONResponse )
123121def upload_minifig_image (file : UploadFile = File (...)) -> JSONResponse :
124122 """
125123 走行体から、受け取った4枚のミニフィグの画像から一番正面らしいものを競技システムにアップロードする関数.
@@ -134,10 +132,8 @@ def upload_minifig_image(file: UploadFile = File(...)) -> JSONResponse:
134132 # 画像のファイル名の取得
135133 file_name = file .filename
136134
137- # プロジェクトルートディレクトリのパスを取得(3階層上に移動)
138- project_root = os .path .dirname (os .path .dirname (os .path .dirname (__file__ )))
139135 # 画像保存用ディレクトリのパスを設定
140- image_data_dir = os .path .join (project_root , ' image_data' )
136+ image_data_dir = os .path .join (" image_data" )
141137
142138 # image_dataディレクトリが存在しない場合は作成
143139 os .makedirs (image_data_dir , exist_ok = True )
0 commit comments