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

Updated to a smaller container

Browse files
Files changed (4) hide show
  1. .dockerignore +2 -0
  2. Dockerfile +5 -13
  3. app.py +3 -2
  4. requirements.txt +95 -1
.dockerignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ /venv
2
+ /flagged
Dockerfile CHANGED
@@ -1,26 +1,18 @@
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" ]
 
1
+ FROM continuumio/miniconda3
2
  EXPOSE 7860
3
 
 
4
  RUN apt-get update && \
5
+ apt-get install -y --no-install-recommends libgl1-mesa-glx && \
6
+ apt-get install -y --no-install-recommends libglib2.0-0 && \
 
 
7
  apt-get clean && \
8
  rm -rf /var/lib/apt/lists/*
9
 
 
 
 
 
 
10
  ENV GRADIO_SERVER_NAME=0.0.0.0
11
  WORKDIR /workspace
12
 
13
  ADD environment.yaml /workspace/environment.yaml
14
+ RUN conda env update -n base --file environment.yaml && \
15
+ pip install typing-extensions -U
16
 
17
  ADD app.py /workspace/
18
  CMD [ "python" , "/workspace/app.py" ]
app.py CHANGED
@@ -1,6 +1,5 @@
1
  from fawkes.protection import Fawkes
2
  import gradio as gr
3
- import os
4
 
5
  def predict(level, img):
6
  # print(img)
@@ -10,4 +9,6 @@ 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()
 
 
 
1
  from fawkes.protection import Fawkes
2
  import gradio as gr
 
3
 
4
  def predict(level, img):
5
  # print(img)
 
9
  # print(os.listdir('/tmp'))
10
  return splt[0] + "_cloaked." + splt[1]
11
 
12
+ gr.Interface(fn=predict, inputs=[gr.components.Dropdown(["low", "mid", "high"], label="Protection Level"),
13
+ gr.components.Image(type='filepath')],
14
+ outputs=gr.components.Image(type="pil")).launch(show_error=True)
requirements.txt CHANGED
@@ -1 +1,95 @@
1
- fawkes==1.0.4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ absl-py==0.15.0
2
+ aiohttp==3.8.3
3
+ aiosignal==1.3.1
4
+ analytics-python==1.4.0
5
+ anyio==3.6.2
6
+ astunparse==1.6.3
7
+ async-timeout==4.0.2
8
+ asynctest==0.13.0
9
+ attrs==22.1.0
10
+ backoff==1.10.0
11
+ bcrypt==4.0.1
12
+ bleach==5.0.1
13
+ cachetools==5.2.0
14
+ certifi==2022.9.24
15
+ cffi==1.15.1
16
+ charset-normalizer==2.1.1
17
+ click==8.1.3
18
+ cryptography==38.0.3
19
+ cycler==0.11.0
20
+ fastapi==0.76.0
21
+ fawkes==1.0.4
22
+ ffmpy==0.3.0
23
+ flatbuffers==1.12
24
+ fonttools==4.38.0
25
+ frozenlist==1.3.3
26
+ fsspec==2022.10.0
27
+ gast==0.3.3
28
+ google-auth==2.14.1
29
+ google-auth-oauthlib==0.4.6
30
+ google-pasta==0.2.0
31
+ gradio==3.0.20
32
+ grpcio==1.32.0
33
+ h11==0.14.0
34
+ h5py==2.10.0
35
+ idna==3.4
36
+ importlib-metadata==5.0.0
37
+ Jinja2==3.1.2
38
+ Keras==2.4.3
39
+ Keras-Preprocessing==1.1.2
40
+ kiwisolver==1.4.4
41
+ linkify-it-py==1.0.3
42
+ Markdown==3.4.1
43
+ markdown-it-py==2.1.0
44
+ MarkupSafe==2.1.1
45
+ matplotlib==3.5.3
46
+ mdit-py-plugins==0.3.1
47
+ mdurl==0.1.2
48
+ monotonic==1.6
49
+ mtcnn==0.1.1
50
+ multidict==6.0.2
51
+ numpy==1.19.5
52
+ oauthlib==3.2.2
53
+ opencv-python==4.6.0.66
54
+ opt-einsum==3.3.0
55
+ orjson==3.8.1
56
+ packaging==21.3
57
+ pandas==1.3.5
58
+ paramiko==2.12.0
59
+ Pillow==9.3.0
60
+ pkg_resources==0.0.0
61
+ protobuf==3.20.3
62
+ pyasn1==0.4.8
63
+ pyasn1-modules==0.2.8
64
+ pycparser==2.21
65
+ pycryptodome==3.15.0
66
+ pydantic==1.9.2
67
+ pydub==0.25.1
68
+ PyNaCl==1.5.0
69
+ pyparsing==3.0.9
70
+ python-dateutil==2.8.2
71
+ python-multipart==0.0.5
72
+ pytz==2022.6
73
+ PyYAML==6.0
74
+ requests==2.28.1
75
+ requests-oauthlib==1.3.1
76
+ rsa==4.9
77
+ scipy==1.7.3
78
+ six==1.15.0
79
+ sniffio==1.3.0
80
+ starlette==0.18.0
81
+ tensorboard==2.11.0
82
+ tensorboard-data-server==0.6.1
83
+ tensorboard-plugin-wit==1.8.1
84
+ tensorflow==2.4.1
85
+ tensorflow-estimator==2.4.0
86
+ termcolor==1.1.0
87
+ typing_extensions==4.4.0
88
+ uc-micro-py==1.0.1
89
+ urllib3==1.26.12
90
+ uvicorn==0.19.0
91
+ webencodings==0.5.1
92
+ Werkzeug==2.2.2
93
+ wrapt==1.12.1
94
+ yarl==1.8.1
95
+ zipp==3.10.0