Suite et fin des tests :
j’ai modifié le fichier demo.html parce être sûr que l’appel se faisait bien sur le bon port, en mettant :
<form method="post" action="http://127.0.0.1:8001/detect/" enctype="multipart/form-data" novalidate class="">
Et là le terminal 1 réagit, mais m’affiche une erreur qui me paraît insoluble à notre niveau : le dossier “/dev/shm/detect108988.jpg” ne me paraît pas possible dans un environnement Windows (ça correspond davantage à du linux / macos)
INFO: [127.0.0.1:50443](http://127.0.0.1:50443) - "POST /detect/ HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\uvicorn\protocols\http\h11_[impl.py](http://impl.py)", line 403, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\uvicorn\middleware\proxy_[headers.py](http://headers.py)", line 60, in __call__
return await [self.app(scope](http://self.app(scope), receive, send)
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\fastapi\[applications.py](http://applications.py)", line 1054, in __call__
await super().__call__(scope, receive, send)
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\starlette\[applications.py](http://applications.py)", line 112, in __call__
await self.middleware_stack(scope, receive, send)
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\starlette\middleware\[errors.py](http://errors.py)", line 187, in __call__
raise exc
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\starlette\middleware\[errors.py](http://errors.py)", line 165, in __call__
await [self.app(scope](http://self.app(scope), receive, _send)
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\starlette\middleware\[exceptions.py](http://exceptions.py)", line 62, in __call__
await wrap_app_handling_exceptions([self.app](http://self.app), conn)(scope, receive, send)
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\starlette\_exception_[handler.py](http://handler.py)", line 53, in wrapped_app
raise exc
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\starlette\_exception_[handler.py](http://handler.py)", line 42, in wrapped_app
await app(scope, receive, sender)
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\starlette\[routing.py](http://routing.py)", line 714, in __call__
await self.middleware_stack(scope, receive, send)
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\starlette\[routing.py](http://routing.py)", line 734, in app
await route.handle(scope, receive, send)
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\starlette\[routing.py](http://routing.py)", line 288, in handle
await [self.app(scope](http://self.app(scope), receive, send)
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\starlette\[routing.py](http://routing.py)", line 76, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\starlette\_exception_[handler.py](http://handler.py)", line 53, in wrapped_app
raise exc
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\starlette\_exception_[handler.py](http://handler.py)", line 42, in wrapped_app
await app(scope, receive, sender)
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\starlette\[routing.py](http://routing.py)", line 73, in app
response = await f(request)
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\fastapi\[routing.py](http://routing.py)", line 301, in app
raw_response = await run_endpoint_function(
File "E:\Panoramax_detection\sgblur\env\lib\site-packages\fastapi\[routing.py](http://routing.py)", line 212, in run_endpoint_function
return await [dependant.call](http://dependant.call)(**values)
File "E:\Panoramax_detection\sgblur\src\detect\detect_[api.py](http://api.py)", line 14, in detect_api
result = detect.detector(picture.file, cls)
File "E:\Panoramax_detection\sgblur\src\detect\[detect.py](http://detect.py)", line 138, in detector
with open(tmp, 'w+b') as jpg:
FileNotFoundError: [Errno 2] No such file or directory: '/dev/shm/detect108988.jpg'
INFO: [127.0.0.1:50444](http://127.0.0.1:50444) - "GET /favicon.ico HTTP/1.1" 404 Not Found
PS
à titre perso, j’ai rien compris à ce que j’ai écris dans ces messages
(mais j’ai confiance en la personne qui me les a soufflés !)