Skip to content

Commit

Permalink
Removed python env. Template HTML design changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shridpant committed Sep 24, 2020
1 parent 187f28f commit 6bd74c7
Show file tree
Hide file tree
Showing 861 changed files with 67 additions and 123,341 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: gunicorn app:app
web: gunicorn app:app
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[![Issues][issues]][issues-url]

<br />
<p align="center">
<a href="https://github.com/shridpant/smort-apps">
<img src="static/logo.png" alt="Logo" width="80" height="80">
</a>

<h3 align="center">Hot Dog or Not</h3>

<p align="center">
Welcome to this GitHub repository!
<br />
<a href="https://github.com/shridpant/smort-apps"><strong>Explore the docs »</strong></a>
<br />
<br />
·
<a href="https://github.com/shridpant/smort-apps/issues">Report Bug</a>
·
<a href="https://github.com/shridpant/smort-apps/issues">Request Feature</a>
</p>
</p>


<!-- TABLE OF CONTENTS -->
## Table of Contents

* [About the Project](#about-the-project)
* [Built With](#built-with)
* [License](#license)
* [Contact](#contact)
* [Acknowledgements](#acknowledgements)

<!-- ABOUT THE PROJECT -->
## About The Project

This repository contains the source code for "Hot Dog or Not" Web App. It was made possible by many open-sourced libraries and frameworks.

### Built With

The web app was built with Flask, Tensorflow, Jinja2 and HTML. See `Acknowledgements` for more info.

<!-- LICENSE -->
## License

Distributed under the MIT license. See `LICENSE` for more information.

<!-- CONTACT -->
## Contact

Shrid Pant - [LinkedIn](https://www.linkedin.com/in/shridpant/)

<!-- ACKNOWLEDGEMENTS -->
## Acknowledements
* [Tensorflow](https://github.com/tensorflow/tensorflow)
* [Bootstrap](https://getbootstrap.com/)
* [VPanjeta/hotdog-or-not-hotdog](https://github.com/VPanjeta/hotdog-or-not-hotdog)
* [Flask](https://flask.palletsprojects.com/en/1.1.x/)
* [Img Shields](https://shields.io)

<!-- MARKDOWN LINKS & IMAGES -->
[issues]: https://img.shields.io/github/issues-raw/shridpant/smort-apps
[issues-url]: https://github.com/shridpant/smort-apps/issues
Binary file added __pycache__/app.cpython-37.pyc
Binary file not shown.
3 changes: 0 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def main_page():

@app.route('/prediction/<filename>')
def prediction(filename):
#my_image = plt.imread(os.path.join('uploads', filename))
my_image = os.getcwd() + '\\static\\' + str(filename)
html_image = image_file = url_for('static', filename=str(filename))
image_file = tf.io.gfile.GFile(my_image, 'rb')
Expand All @@ -32,13 +31,11 @@ def prediction(filename):
tensor = session.graph.get_tensor_by_name('final_result:0')
#^ Feeding data as input and find the first prediction
result = session.run(tensor, {'DecodeJpeg/contents:0': data})

top_results = result[0].argsort()[-len(result[0]):][::-1]
max_score = 0
for type in top_results:
hot_dog_or_not = classes[type]
score = result[0][type]
#print('%-20s : %.5f' % (hot_dog_or_not, score))
if score > max_score:
max_score = score
predictions = hot_dog_or_not
Expand Down
8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

4 changes: 0 additions & 4 deletions runtime.txt

This file was deleted.

File renamed without changes
Binary file added static/one.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/two.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "layout.html" %}
{% block body%}
<h5>Upload your image!</h5>
<h5>Upload your image!</h5> <br />
<form method=post enctype=multipart/form-data>
<p>
<input type=file name=file>
Expand Down
3 changes: 2 additions & 1 deletion templates/predict.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "layout.html" %}
{% block body%}
<p>The image is <em>{{ predictions }}</em></p>
<img src={{ my_image }} width="20%">
<img src={{ my_image }} width="20%"> <br /><br />
<a href="/">Back</a>
{% endblock %}
241 changes: 0 additions & 241 deletions venv/bin/Activate.ps1

This file was deleted.

Loading

0 comments on commit 6bd74c7

Please sign in to comment.