logasja commited on
Commit
e45d31c
·
1 Parent(s): 80def82

Dockerized

Browse files
Files changed (4) hide show
  1. .gitignore +2 -0
  2. Dockerfile +26 -0
  3. app.py +1 -1
  4. environment.yaml +123 -0
.gitignore CHANGED
@@ -127,3 +127,5 @@ dmypy.json
127
 
128
  # Pyre type checker
129
  .pyre/
 
 
 
127
 
128
  # Pyre type checker
129
  .pyre/
130
+
131
+ flagged/
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
2
+ EXPOSE 7860
3
+
4
+ ENV CONDA_DIR /opt/conda
5
+ RUN apt-get update && \
6
+ apt-get install -y build-essential && \
7
+ apt-get install -y wget && \
8
+ apt-get install -y libgl1-mesa-glx && \
9
+ apt-get install -y libglib2.0-0 && \
10
+ apt-get clean && \
11
+ rm -rf /var/lib/apt/lists/*
12
+
13
+ RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
14
+ /bin/bash ~/miniconda.sh -b -p /opt/conda
15
+
16
+ ENV PATH=$CONDA_DIR/bin:$PATH
17
+
18
+ ENV GRADIO_SERVER_NAME=0.0.0.0
19
+ WORKDIR /workspace
20
+
21
+ ADD environment.yaml /workspace/environment.yaml
22
+ RUN conda env update -n base --file environment.yaml
23
+ RUN pip install typing-extensions -U
24
+
25
+ ADD app.py /workspace/
26
+ CMD [ "python" , "/workspace/app.py" ]
app.py CHANGED
@@ -10,4 +10,4 @@ def predict(level, img):
10
  # print(os.listdir('/tmp'))
11
  return splt[0] + "_cloaked." + splt[1]
12
 
13
- gr.Interface(fn=predict, inputs=[gr.inputs.Dropdown(["low", "mid", "high"], label="Protection Level"), gr.inputs.Image(type='filepath')], outputs=gr.outputs.Image(type="pil")).launch()
 
10
  # print(os.listdir('/tmp'))
11
  return splt[0] + "_cloaked." + splt[1]
12
 
13
+ gr.Interface(fn=predict, inputs=[gr.inputs.Dropdown(["low", "mid", "high"], label="Protection Level"), gr.inputs.Image(type='filepath')], outputs=gr.outputs.Image(type="pil")).launch()
environment.yaml ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: gradio
2
+ channels:
3
+ - nvidia
4
+ - conda-forge
5
+ - defaults
6
+ dependencies:
7
+ - _libgcc_mutex=0.1=main
8
+ - _openmp_mutex=5.1=1_gnu
9
+ - ca-certificates=2022.9.24=ha878542_0
10
+ - certifi=2022.9.24=pyhd8ed1ab_0
11
+ - cudatoolkit=11.0.221=h6bb024c_0
12
+ - cudnn=8.0.4=cuda11.0_0
13
+ - libedit=3.1.20210910=h7f8727e_0
14
+ - libffi=3.2.1=hf484d3e_1007
15
+ - libgcc-ng=11.2.0=h1234567_1
16
+ - libgomp=11.2.0=h1234567_1
17
+ - libstdcxx-ng=11.2.0=h1234567_1
18
+ - ncurses=6.3=h5eee18b_3
19
+ - openssl=1.1.1o=h166bdaf_0
20
+ - pip=22.2.2=py38h06a4308_0
21
+ - python=3.8.0=h0371630_2
22
+ - readline=7.0=h7b6447c_5
23
+ - setuptools=63.4.1=py38h06a4308_0
24
+ - sqlite=3.33.0=h62c20be_0
25
+ - tk=8.6.12=h1ccaba5_0
26
+ - wheel=0.37.1=pyhd3eb1b0_0
27
+ - xz=5.2.6=h5eee18b_0
28
+ - zlib=1.2.12=h5eee18b_3
29
+ - pip:
30
+ - absl-py==0.15.0
31
+ - aiohttp==3.8.3
32
+ - aiosignal==1.2.0
33
+ - analytics-python==1.4.0
34
+ - anyio==3.6.1
35
+ - astunparse==1.6.3
36
+ - async-timeout==4.0.2
37
+ - attrs==22.1.0
38
+ - backoff==1.10.0
39
+ - bcrypt==4.0.1
40
+ - bleach==5.0.1
41
+ - cachetools==5.2.0
42
+ - cffi==1.15.1
43
+ - charset-normalizer==2.1.1
44
+ - click==8.1.3
45
+ - contourpy==1.0.5
46
+ - cryptography==38.0.1
47
+ - cycler==0.11.0
48
+ - fastapi==0.76.0
49
+ - fawkes==1.0.4
50
+ - ffmpy==0.3.0
51
+ - flatbuffers==1.12
52
+ - fonttools==4.37.4
53
+ - frozenlist==1.3.1
54
+ - fsspec==2022.8.2
55
+ - gast==0.3.3
56
+ - google-auth==2.12.0
57
+ - google-auth-oauthlib==0.4.6
58
+ - google-pasta==0.2.0
59
+ - gradio==3.0.20
60
+ - grpcio==1.32.0
61
+ - h11==0.14.0
62
+ - h5py==2.10.0
63
+ - idna==3.4
64
+ - importlib-metadata==5.0.0
65
+ - jinja2==3.1.2
66
+ - keras==2.4.3
67
+ - keras-preprocessing==1.1.2
68
+ - kiwisolver==1.4.4
69
+ - linkify-it-py==1.0.3
70
+ - markdown==3.4.1
71
+ - markdown-it-py==2.1.0
72
+ - markupsafe==2.1.1
73
+ - matplotlib==3.6.1
74
+ - mdit-py-plugins==0.3.1
75
+ - mdurl==0.1.2
76
+ - monotonic==1.6
77
+ - mtcnn==0.1.1
78
+ - multidict==6.0.2
79
+ - numpy==1.19.5
80
+ - oauthlib==3.2.1
81
+ - opencv-python==4.6.0.66
82
+ - opt-einsum==3.3.0
83
+ - orjson==3.8.0
84
+ - packaging==21.3
85
+ - pandas==1.4.4
86
+ - paramiko==2.11.0
87
+ - pillow==9.2.0
88
+ - protobuf==3.19.6
89
+ - pyasn1==0.4.8
90
+ - pyasn1-modules==0.2.8
91
+ - pycparser==2.21
92
+ - pycryptodome==3.15.0
93
+ - pydantic==1.9.2
94
+ - pydub==0.25.1
95
+ - pynacl==1.5.0
96
+ - pyparsing==3.0.9
97
+ - python-dateutil==2.8.2
98
+ - python-multipart==0.0.5
99
+ - pytz==2022.4
100
+ - pyyaml==6.0
101
+ - requests==2.28.1
102
+ - requests-oauthlib==1.3.1
103
+ - rsa==4.9
104
+ - scipy==1.9.2
105
+ - six==1.15.0
106
+ - sniffio==1.3.0
107
+ - starlette==0.18.0
108
+ - tensorboard==2.10.1
109
+ - tensorboard-data-server==0.6.1
110
+ - tensorboard-plugin-wit==1.8.1
111
+ - tensorflow==2.4.1
112
+ - tensorflow-estimator==2.4.0
113
+ - termcolor==1.1.0
114
+ - typing-extensions
115
+ - uc-micro-py==1.0.1
116
+ - urllib3==1.26.12
117
+ - uvicorn==0.18.3
118
+ - webencodings==0.5.1
119
+ - werkzeug==2.2.2
120
+ - wrapt==1.12.1
121
+ - yarl==1.8.1
122
+ - zipp==3.9.0
123
+ prefix: /opt/conda/envs/gradio