Jacob Logas commited on
Commit
6d54bbc
·
1 Parent(s): 0effd51
Files changed (2) hide show
  1. Dockerfile +1 -4
  2. app.py +2 -2
Dockerfile CHANGED
@@ -20,17 +20,14 @@ RUN rm /etc/apt/sources.list.d/cuda.list && \
20
  RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
21
 
22
  RUN apt update && \
23
- apt remove -y python3 python
24
  apt install --no-install-recommends -y build-essential software-properties-common libgl1-mesa-glx && \
25
  add-apt-repository -y ppa:deadsnakes/ppa && \
26
  apt install --no-install-recommends -y python3.7 python3.7-distutils && \
27
- # update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 && \
28
  update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2 && \
29
  apt clean && rm -rf /var/lib/apt/lists/*
30
  COPY --from=builder /root/.local/lib/python3.7/site-packages /usr/local/lib/python3.7/dist-packages
31
  COPY app.py app.py
32
 
33
- # RUN ln -s /usr/local/cuda/lib64/libcusolver.so.11 /usr/local/cuda/lib64/libcusolver.so.10
34
-
35
  CMD ["python3", "-u", "app.py"]
36
  EXPOSE 7860
 
20
  RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
21
 
22
  RUN apt update && \
23
+ apt purge -y python3 python && \
24
  apt install --no-install-recommends -y build-essential software-properties-common libgl1-mesa-glx && \
25
  add-apt-repository -y ppa:deadsnakes/ppa && \
26
  apt install --no-install-recommends -y python3.7 python3.7-distutils && \
 
27
  update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2 && \
28
  apt clean && rm -rf /var/lib/apt/lists/*
29
  COPY --from=builder /root/.local/lib/python3.7/site-packages /usr/local/lib/python3.7/dist-packages
30
  COPY app.py app.py
31
 
 
 
32
  CMD ["python3", "-u", "app.py"]
33
  EXPOSE 7860
app.py CHANGED
@@ -1,13 +1,13 @@
1
  from fawkes.protection import Fawkes
2
  import gradio as gr
3
- import os
4
 
5
  def predict(img, level):
6
  # print(img)
7
  fwks = Fawkes("extractor_2", '0', 1, mode=level)
8
  fwks.run_protection([img], format='jpeg')
9
  splt = img.split(".")
10
- print(os.listdir('/tmp'))
11
  return splt[0] + "_cloaked.jpeg"
12
 
13
  gr.Interface(fn=predict, inputs=[gr.components.Image(type='filepath'),
 
1
  from fawkes.protection import Fawkes
2
  import gradio as gr
3
+ # import os
4
 
5
  def predict(img, level):
6
  # print(img)
7
  fwks = Fawkes("extractor_2", '0', 1, mode=level)
8
  fwks.run_protection([img], format='jpeg')
9
  splt = img.split(".")
10
+ # print(os.listdir('/tmp'))
11
  return splt[0] + "_cloaked.jpeg"
12
 
13
  gr.Interface(fn=predict, inputs=[gr.components.Image(type='filepath'),