Spaces:
Runtime error
Runtime error
Commit
·
7165e24
1
Parent(s):
eb8f9d9
Adding files.
Browse filesFormer-commit-id: 3a00b01d74dd943759ab48e448872aa1091e3a64
- README.md +13 -0
- assets/bonk.png +0 -0
- assets/template_styles/cogs.jpg +0 -0
- assets/template_styles/cow.jpg +0 -0
- assets/template_styles/crystals.jpg +0 -0
- assets/template_styles/eyess.jpg +0 -0
- assets/template_styles/fire.jpg +0 -0
- assets/template_styles/gems.jpg +0 -0
- assets/template_styles/ice.jpg +0 -0
- assets/template_styles/leaves.jpeg +0 -0
- assets/template_styles/leaves.png +0 -0
- assets/template_styles/oranges.jpg +0 -0
- assets/template_styles/pattern.jpeg +0 -0
- assets/template_styles/pebbles.jpg +0 -0
- assets/template_styles/penrose.jpg +0 -0
- assets/template_styles/polka.jpeg +0 -0
- assets/template_styles/pumpkin.jpg +0 -0
- assets/template_styles/rainbow.png +0 -0
- assets/template_styles/rainbow_squares.jpg +0 -0
- assets/template_styles/rocks.jpeg +0 -0
- assets/template_styles/screm.jpg +0 -0
- assets/template_styles/spaceship.jpg +0 -0
- assets/template_styles/squares.png +0 -0
- assets/template_styles/swirl.jpg +0 -0
- assets/template_styles/technology.jpg +0 -0
- assets/template_styles/tiles.jpg +0 -0
- assets/template_styles/trees.jpg +0 -0
- assets/template_styles/yosemite.jpg +0 -0
- assets/template_styles/zigzag.jpg +0 -0
- setup.py +21 -0
- streamlit_app.py +2 -2
- style/1/saved_model.pb +0 -0
- style/1/variables/variables.data-00000-of-00001.REMOVED.git-id +1 -0
- style/1/variables/variables.index +0 -0
README.md
CHANGED
@@ -1,3 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
## Dependencies
|
2 |
- Tensorflow serving apis
|
3 |
- Python 3.6+
|
|
|
1 |
+
## Webcam Demo
|
2 |
+
- Run `firstTimeSetup.sh`
|
3 |
+
- Activate virtualenv `source venv/bin/activate`
|
4 |
+
- Run streamlit webcam application `streamlit run webcam_stream.py`
|
5 |
+
|
6 |
+
|
7 |
+
## Image Demo
|
8 |
+
- Run `firstTimeSetup.sh`
|
9 |
+
- Activate virtualenv `source venv/bin/activate`
|
10 |
+
- Pull tensorflow serving docker image and start tensorflow model server `make model-server`
|
11 |
+
- In separate terminal call `make app`
|
12 |
+
|
13 |
+
|
14 |
## Dependencies
|
15 |
- Tensorflow serving apis
|
16 |
- Python 3.6+
|
assets/bonk.png
ADDED
![]() |
assets/template_styles/cogs.jpg
ADDED
![]() |
assets/template_styles/cow.jpg
ADDED
![]() |
assets/template_styles/crystals.jpg
ADDED
![]() |
assets/template_styles/eyess.jpg
ADDED
![]() |
assets/template_styles/fire.jpg
ADDED
![]() |
assets/template_styles/gems.jpg
ADDED
![]() |
assets/template_styles/ice.jpg
ADDED
![]() |
assets/template_styles/leaves.jpeg
ADDED
![]() |
assets/template_styles/leaves.png
ADDED
![]() |
assets/template_styles/oranges.jpg
ADDED
![]() |
assets/template_styles/pattern.jpeg
ADDED
![]() |
assets/template_styles/pebbles.jpg
ADDED
![]() |
assets/template_styles/penrose.jpg
ADDED
![]() |
assets/template_styles/polka.jpeg
ADDED
![]() |
assets/template_styles/pumpkin.jpg
ADDED
![]() |
assets/template_styles/rainbow.png
ADDED
![]() |
assets/template_styles/rainbow_squares.jpg
ADDED
![]() |
assets/template_styles/rocks.jpeg
ADDED
![]() |
assets/template_styles/screm.jpg
ADDED
![]() |
assets/template_styles/spaceship.jpg
ADDED
![]() |
assets/template_styles/squares.png
ADDED
![]() |
assets/template_styles/swirl.jpg
ADDED
![]() |
assets/template_styles/technology.jpg
ADDED
![]() |
assets/template_styles/tiles.jpg
ADDED
![]() |
assets/template_styles/trees.jpg
ADDED
![]() |
assets/template_styles/yosemite.jpg
ADDED
![]() |
assets/template_styles/zigzag.jpg
ADDED
![]() |
setup.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from setuptools import setup
|
2 |
+
|
3 |
+
setup(
|
4 |
+
name='neural-style',
|
5 |
+
version='',
|
6 |
+
packages=[],
|
7 |
+
install_requires=[
|
8 |
+
'opencv-python==4.4.0.46',
|
9 |
+
'tensorflow==2.3.0',
|
10 |
+
'streamlit==0.70.0',
|
11 |
+
'numpy==1.19.4',
|
12 |
+
'grpcio==1.33.2',
|
13 |
+
'tensorflow-serving-api==2.3.0',
|
14 |
+
|
15 |
+
],
|
16 |
+
url='',
|
17 |
+
license='',
|
18 |
+
author='albert',
|
19 |
+
author_email='',
|
20 |
+
description=''
|
21 |
+
)
|
streamlit_app.py
CHANGED
@@ -19,7 +19,7 @@ def main():
|
|
19 |
col1, col2 = st.beta_columns(2)
|
20 |
content_file = st.sidebar.file_uploader('Upload Image', type=['jpg', 'jpeg', 'png'])
|
21 |
style_file = st.sidebar.file_uploader('Upload Style', type=['jpg', 'jpeg', 'png'])
|
22 |
-
style_options = st.sidebar.selectbox(label='Example Styles', options=os.listdir('template_styles'))
|
23 |
col1.subheader('Content Image')
|
24 |
col2.subheader('Style Image')
|
25 |
show_image = col1.empty()
|
@@ -39,7 +39,7 @@ def main():
|
|
39 |
style = style_file.getvalue()
|
40 |
show_style.image(style, use_column_width=True)
|
41 |
elif style_options is not None:
|
42 |
-
with open(os.path.join('template_styles', style_options), 'rb') as f:
|
43 |
style = f.read()
|
44 |
show_style.image(style, use_column_width=True)
|
45 |
|
|
|
19 |
col1, col2 = st.beta_columns(2)
|
20 |
content_file = st.sidebar.file_uploader('Upload Image', type=['jpg', 'jpeg', 'png'])
|
21 |
style_file = st.sidebar.file_uploader('Upload Style', type=['jpg', 'jpeg', 'png'])
|
22 |
+
style_options = st.sidebar.selectbox(label='Example Styles', options=os.listdir('assets/template_styles'))
|
23 |
col1.subheader('Content Image')
|
24 |
col2.subheader('Style Image')
|
25 |
show_image = col1.empty()
|
|
|
39 |
style = style_file.getvalue()
|
40 |
show_style.image(style, use_column_width=True)
|
41 |
elif style_options is not None:
|
42 |
+
with open(os.path.join('assets/template_styles', style_options), 'rb') as f:
|
43 |
style = f.read()
|
44 |
show_style.image(style, use_column_width=True)
|
45 |
|
style/1/saved_model.pb
ADDED
Binary file (1.78 MB). View file
|
|
style/1/variables/variables.data-00000-of-00001.REMOVED.git-id
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
32c1044a28bd76fc7aec2d67c9bfb365b351422e
|
style/1/variables/variables.index
ADDED
Binary file (30.2 kB). View file
|
|