fidler-lab/polyrnn-pp-pytorch

Some question about Backend and Frontend

Luoxd1996 opened this issue · 1 comments

  1. problem about Backend:When I run this command "python Tool/tool.py --exp Experiments/tool.json --reload <path_to_model> --port --image_dir Tool/frontend/static/img/" will some error which is " WARNING: Do not use the development server in a production environment." and I run this command "export FLASK_ENV=development" and then Onmy browser, I navigated to localhost:8000. but there is 404 Not Found.
  2. problem about Frontend:If I run Backend command, this port 8000 can't be used again.
    So I can't understand how to run this demo like that gif picture which named polydemo.gif.

Hi, so the way this works is:

  1. The backend runs on a port (we use default 5001). If you pass a separate port number to tool.py, you will need to edit index.html in the frontend to reflect that.

  2. The frontend can be run on any port: if you run python -m SimpleHTTPServer, it runs by default on port 8000. It sends requests to the backend server, which is listening on localhost:<backend_port> (if you run it on your own machine, then it's localhost. If it's on a server, then the backend is at <SERVER_IP/SERVER_DNS_NAME>:<backend_port>).

So the correct steps (if you run on your own machine) are:

  1. Run backend (without passing port argument if you don't care which port) -- this makes the server run on localhost:5001

  2. Run frontend on whichever port you like and then navigate to localhost:<whichever_port_you_run_frontend_at>