UnboundLocalError: cannot access local variable 'frames_dir' where it is not associated with a value [1] INFO: 127.0.0.1:44838 - "GET /status/217396f8-55f3-4dac-a53e-5436bea24dae HTTP/1.1" 200 OK [1] INFO: 127.0.0.1:40952 - "POST /remove_background_video/ HTTP/1.1" 200 OK [1] ERROR:main:Error in video processing [1] Traceback (most recent call last): [1] File "/home/jordancruz/Tools/bgbye/server/server.py", line 170, in process_video [1] process = await asyncio.create_subprocess_exec( [1] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] File "/usr/lib/python3.12/asyncio/subprocess.py", line 224, in create_subprocess_exec [1] transport, protocol = await loop.subprocess_exec( [1] ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] File "uvloop/loop.pyx", line 2820, in subprocess_exec [1] File "uvloop/loop.pyx", line 2778, in subprocess_run [1] File "uvloop/handles/process.pyx", line 611, in uvloop.loop.UVProcessTransport.new [1] File "uvloop/handles/process.pyx", line 112, in uvloop.loop.UVProcess._init [1] FileNotFoundError: [Errno 2] No such file or directory [1] ERROR: Exception in ASGI application [1] Traceback (most recent call last): [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi [1] result = await app( # type: ignore[func-returns-value] [1] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in call [1] return await self.app(scope, receive, send) [1] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in call [1] await super().call(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/applications.py", line 123, in call [1] await self.middleware_stack(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in call [1] raise exc [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in call [1] await self.app(scope, receive, _send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 93, in call [1] await self.simple_response(scope, receive, send, request_headers=headers) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 148, in simple_response [1] await self.app(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in call__ [1] await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app [1] raise exc [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app [1] await app(scope, receive, sender) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/routing.py", line 754, in call [1] await self.middleware_stack(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/routing.py", line 774, in app [1] await route.handle(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/routing.py", line 295, in handle [1] await self.app(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/routing.py", line 77, in app [1] await wrap_app_handling_exceptions(app, request)(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app [1] raise exc [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app [1] await app(scope, receive, sender) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/routing.py", line 75, in app [1] await response(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/responses.py", line 162, in call [1] await self.background() [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/background.py", line 45, in call [1] await task() [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/background.py", line 28, in call [1] await self.func(*self.args, **self.kwargs) [1] File "/home/jordancruz/Tools/bgbye/server/server.py", line 270, in process_video [1] for file in os.listdir(frames_dir): [1] ^^^^^^^^^^ [1] UnboundLocalError: cannot access local variable 'frames_dir' where it is not associated with a value [1] INFO: 127.0.0.1:40954 - "GET /status/3933d3c5-9fc4-4c03-b55b-9415d18d43f0 HTTP/1.1" 200 OK
UnboundLocalError: cannot access local variable 'frames_dir' where it is not associated with a value [1] INFO: 127.0.0.1:44838 - "GET /status/217396f8-55f3-4dac-a53e-5436bea24dae HTTP/1.1" 200 OK [1] INFO: 127.0.0.1:40952 - "POST /remove_background_video/ HTTP/1.1" 200 OK [1] ERROR:main:Error in video processing [1] Traceback (most recent call last): [1] File "/home/jordancruz/Tools/bgbye/server/server.py", line 170, in process_video [1] process = await asyncio.create_subprocess_exec( [1] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] File "/usr/lib/python3.12/asyncio/subprocess.py", line 224, in create_subprocess_exec [1] transport, protocol = await loop.subprocess_exec( [1] ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] File "uvloop/loop.pyx", line 2820, in subprocess_exec [1] File "uvloop/loop.pyx", line 2778, in subprocess_run [1] File "uvloop/handles/process.pyx", line 611, in uvloop.loop.UVProcessTransport.new [1] File "uvloop/handles/process.pyx", line 112, in uvloop.loop.UVProcess._init [1] FileNotFoundError: [Errno 2] No such file or directory [1] ERROR: Exception in ASGI application [1] Traceback (most recent call last): [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi [1] result = await app( # type: ignore[func-returns-value] [1] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in call [1] return await self.app(scope, receive, send) [1] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in call [1] await super().call(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/applications.py", line 123, in call [1] await self.middleware_stack(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in call [1] raise exc [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in call [1] await self.app(scope, receive, _send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 93, in call [1] await self.simple_response(scope, receive, send, request_headers=headers) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 148, in simple_response [1] await self.app(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in call__ [1] await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app [1] raise exc [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app [1] await app(scope, receive, sender) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/routing.py", line 754, in call [1] await self.middleware_stack(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/routing.py", line 774, in app [1] await route.handle(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/routing.py", line 295, in handle [1] await self.app(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/routing.py", line 77, in app [1] await wrap_app_handling_exceptions(app, request)(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app [1] raise exc [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app [1] await app(scope, receive, sender) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/routing.py", line 75, in app [1] await response(scope, receive, send) [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/responses.py", line 162, in call [1] await self.background() [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/background.py", line 45, in call [1] await task() [1] File "/home/jordancruz/Tools/bgbye/server/venv/lib/python3.12/site-packages/starlette/background.py", line 28, in call [1] await self.func(*self.args, **self.kwargs) [1] File "/home/jordancruz/Tools/bgbye/server/server.py", line 270, in process_video [1] for file in os.listdir(frames_dir): [1] ^^^^^^^^^^ [1] UnboundLocalError: cannot access local variable 'frames_dir' where it is not associated with a value [1] INFO: 127.0.0.1:40954 - "GET /status/3933d3c5-9fc4-4c03-b55b-9415d18d43f0 HTTP/1.1" 200 OK