Spaces:
Runtime error
Runtime error
Commit
·
f161731
1
Parent(s):
7165e24
Removing model file. Making setup path agnostic
Browse filesFormer-commit-id: 85897dba0ca300ba52dd3b5ad43fbd3ed785d77b
- Makefile +7 -2
- README.md +9 -11
- style/1/saved_model.pb +0 -0
- style/1/variables/variables.data-00000-of-00001.REMOVED.git-id +0 -1
- style/1/variables/variables.index +0 -0
- webcam_stream.py +1 -1
Makefile
CHANGED
@@ -1,8 +1,13 @@
|
|
|
|
|
|
1 |
model-server: style
|
2 |
-
docker run --gpus all -p 8500:8500 --mount type=bind,source
|
3 |
|
4 |
model-server-cpu: style
|
5 |
-
docker run -p 8500:8500 --mount type=bind,source
|
6 |
|
7 |
app:
|
8 |
exec streamlit run streamlit_app.py
|
|
|
|
|
|
|
|
1 |
+
CURRENT_DIR = $(shell pwd)
|
2 |
+
|
3 |
model-server: style
|
4 |
+
docker run --gpus all -p 8500:8500 --mount type=bind,source=${CURRENT_DIR}/style,target=/models/style -e MODEL_NAME=style -t tensorflow/serving:latest-gpu
|
5 |
|
6 |
model-server-cpu: style
|
7 |
+
docker run -p 8500:8500 --mount type=bind,source=${CURRENT_DIR}/style,target=/models/style -e MODEL_NAME=style -t tensorflow/serving
|
8 |
|
9 |
app:
|
10 |
exec streamlit run streamlit_app.py
|
11 |
+
|
12 |
+
webcam:
|
13 |
+
exec streamlit run webcam_stream.py
|
README.md
CHANGED
@@ -1,14 +1,16 @@
|
|
1 |
-
##
|
2 |
- Run `firstTimeSetup.sh`
|
3 |
- Activate virtualenv `source venv/bin/activate`
|
4 |
-
-
|
|
|
|
|
|
|
5 |
|
6 |
|
7 |
## Image Demo
|
8 |
-
-
|
9 |
-
-
|
10 |
-
-
|
11 |
-
- In separate terminal call `make app`
|
12 |
|
13 |
|
14 |
## Dependencies
|
@@ -17,8 +19,4 @@
|
|
17 |
- Docker
|
18 |
- Nvidia-docker
|
19 |
- tensorflow/serving:latest-gpu image
|
20 |
-
-
|
21 |
-
- gocv
|
22 |
-
- tensorflow and tensorflow/serving repositories (for golang protobufs)
|
23 |
-
- golang protobuf library
|
24 |
-
- protobuf compiler
|
|
|
1 |
+
## Setup for both
|
2 |
- Run `firstTimeSetup.sh`
|
3 |
- Activate virtualenv `source venv/bin/activate`
|
4 |
+
- Download style transfer model `python download_model.py`
|
5 |
+
|
6 |
+
## Webcam Demo
|
7 |
+
- Run streamlit webcam application inside virtualenv `make webcam`
|
8 |
|
9 |
|
10 |
## Image Demo
|
11 |
+
- Pull tensorflow serving docker image and start tensorflow model server `make model-server-cpu`
|
12 |
+
- If you want to use GPU instead and have `nvidia-docker` then call `make model-server`
|
13 |
+
- In separate terminal call in virtualenv `make app`
|
|
|
14 |
|
15 |
|
16 |
## Dependencies
|
|
|
19 |
- Docker
|
20 |
- Nvidia-docker
|
21 |
- tensorflow/serving:latest-gpu image
|
22 |
+
- tensorflow and tensorflow/serving repositories (for golang protobufs)
|
|
|
|
|
|
|
|
style/1/saved_model.pb
DELETED
Binary file (1.78 MB)
|
|
style/1/variables/variables.data-00000-of-00001.REMOVED.git-id
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
32c1044a28bd76fc7aec2d67c9bfb365b351422e
|
|
|
|
style/1/variables/variables.index
DELETED
Binary file (30.2 kB)
|
|
webcam_stream.py
CHANGED
@@ -80,7 +80,7 @@ def main():
|
|
80 |
frame_rate = st.text(f'Frames per second: 0')
|
81 |
|
82 |
if webcam_flag:
|
83 |
-
video_capture = WebcamVideoStream(
|
84 |
start = time.time()
|
85 |
total_frames = 0
|
86 |
try:
|
|
|
80 |
frame_rate = st.text(f'Frames per second: 0')
|
81 |
|
82 |
if webcam_flag:
|
83 |
+
video_capture = WebcamVideoStream(0)
|
84 |
start = time.time()
|
85 |
total_frames = 0
|
86 |
try:
|