fidler-lab / polyrnn-pp-pytorch

PyTorch training/tool code for Polygon-RNN++ (CVPR 2018)
704 stars 106 forks source link

Some question about Backend and Frontend #2

Closed Luoxd1996 closed 6 years ago

Luoxd1996 commented 6 years ago
  1. problem about Backend:When I run this command "python Tool/tool.py --exp Experiments/tool.json --reload --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.
amlankar commented 6 years ago

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: (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>:).

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: