Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

Webapp #68

Merged
merged 45 commits into from
Jun 22, 2018
Merged

Webapp #68

merged 45 commits into from
Jun 22, 2018

Conversation

delhomer
Copy link
Contributor

This PR introduces a brand new way for visualizing deep learning predictions through a Flask web application.
The application is quite simple, as no real focus has been done on formatting web pages. However, it provides a first complete picture of the project results.

In order to make the Flask app happen, some symbolic link must be designed:

  • deeposlandia/static/shapes that points on shape image folder (the folder that contains a images and a labels subrepositories), for demo purpose.
  • deeposlandia/static/mapillary that points on mapillary image folder for demo purpose (see previous point).
  • deeposlandia/static/predicted_images that points to a server-side temporary folder to store predicted images (labelled versions of tested images).
  • deeposlandia/static/sample_image that points to images repository within the deeposlandia project, so as to display example images at web page first visits.

This PR fixes issue #55 .

@delhomer delhomer requested a review from garaud June 21, 2018 16:01
Copy link
Contributor

@garaud garaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Congrats.

I think that the symbolic link part with the different image folders could be in a specific configuration file, read by the Flask app when it starts.

It's not very clear to me the name of the different routes: demo_predictor, predictor, predictor_demo. You don't know if it's a route which serves a HTML file, or a route which serves some JSON data. And I think you should add some docstring.

};

// get the date before today in YYYY-MM-DD string format
function getYesterday() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this function mandatory? Maybe you don't neet it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, indeed. Actually the whole app.js is useless for deeposlandia. I remove it.


// Build the URL with a BASE_URL/<city> suffix based from a DOM element with the
// "city" dataset attribute, i.e. 'data-city'.
function cityurl(dom_id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legacy copy/pasting from jitenshea I think. You can remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're write, I remove the file from the project. :)


app = Flask(__name__)
app.config['ERROR_404_HELP'] = False
app.config['SWAGGER_UI_DOC_EXPANSION'] = 'list'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you don't use Swagger, you can remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

# if user does not select file, browser also
# submit a empty part without filename
if file.filename == '':
print('No selected file')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remaining print

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this is a stackoverflow-oriented development issue, there... Maybe we can keep the log as the function behavior still have to be clarified. I replace print statements with utils.logger.info.

@delhomer
Copy link
Contributor Author

delhomer commented Jun 22, 2018

I agree regarding the symbolic link point. I will add a dedicated issue to keep it in our mind.
Additionally, I will add a new commit with docstrings for webapp.py methods.

… be used by the web application

Before this commit inference.py was only a standalone module, with a
main method usable in a terminal. From now, the corresponding
treatments have been encapsulated in a dedicated function. We can
still call inference.py to make label predictions; additionnally, it
can be used into the web application.
…to demo

This commit extends the web app modification to javascript code, to
make the demo page show the ground truth image. At this point, we must
add that symbolic links are fundamental to succeed in displaying the
demo results. There is a `shapes` link that directs to the demo shapes
dataset, either do the `mapillary` symbolic link. Both datasets are
structured with two subdirectories (`images` and `labels`) where
images are picked.
…ll as predictions with accurate label colors
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants