Jiecong Lin commited on
Commit
e697160
·
1 Parent(s): 0c1b085

FIX dockerfile

Browse files
Files changed (2) hide show
  1. Dockerfile +6 -3
  2. app.py +1 -10
Dockerfile CHANGED
@@ -1,5 +1,6 @@
1
  FROM nvidia/cuda:12.5.1-cudnn-runtime-ubuntu22.04
2
  ENV DEBIAN_FRONTEND=noninteractive
 
3
  ENV MPLCONFIGDIR=/tmp/matplotlib
4
  RUN apt-get update && apt-get install -y \
5
  python3.11 \
@@ -24,6 +25,8 @@ RUN pip3 install -e .
24
  # RUN pip3 install -e ".[demo]"
25
  WORKDIR /app/segment-anything-2/checkpoints
26
  RUN ./download_ckpts.sh
27
- WORKDIR /app/segment-anything-2
28
- COPY app.py /app/segment-anything-2/app.py
29
- CMD ["python3", "app.py"]
 
 
 
1
  FROM nvidia/cuda:12.5.1-cudnn-runtime-ubuntu22.04
2
  ENV DEBIAN_FRONTEND=noninteractive
3
+ ENV PYTHONUNBUFFERED=1
4
  ENV MPLCONFIGDIR=/tmp/matplotlib
5
  RUN apt-get update && apt-get install -y \
6
  python3.11 \
 
25
  # RUN pip3 install -e ".[demo]"
26
  WORKDIR /app/segment-anything-2/checkpoints
27
  RUN ./download_ckpts.sh
28
+ WORKDIR /app
29
+ EXPOSE 7860
30
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
31
+ COPY app.py /app/app.py
32
+ CMD ["python3", "-u", "app.py"]
app.py CHANGED
@@ -1,23 +1,14 @@
1
  # import subprocess
2
  # import re
3
  # from typing import List, Tuple, Optional
4
-
5
- # # Define the command to be executed
6
  # command = ["python", "setup.py", "build_ext", "--inplace"]
7
-
8
- # # Execute the command
9
  # result = subprocess.run(command, capture_output=True, text=True)
10
-
11
- # # Print the output and error (if any)
12
  # print("Output:\n", result.stdout)
13
  # print("Errors:\n", result.stderr)
14
-
15
- # # Check if the command was successful
16
  # if result.returncode == 0:
17
  # print("Command executed successfully.")
18
  # else:
19
  # print("Command failed with return code:", result.returncode)
20
-
21
  import gc
22
  import math
23
  import os
@@ -566,7 +557,7 @@ def seg_track_app():
566
  )
567
 
568
  app.queue(concurrency_count=1)
569
- app.launch(debug=True, enable_queue=True, share=True)
570
 
571
  if __name__ == "__main__":
572
  seg_track_app()
 
1
  # import subprocess
2
  # import re
3
  # from typing import List, Tuple, Optional
 
 
4
  # command = ["python", "setup.py", "build_ext", "--inplace"]
 
 
5
  # result = subprocess.run(command, capture_output=True, text=True)
 
 
6
  # print("Output:\n", result.stdout)
7
  # print("Errors:\n", result.stderr)
 
 
8
  # if result.returncode == 0:
9
  # print("Command executed successfully.")
10
  # else:
11
  # print("Command failed with return code:", result.returncode)
 
12
  import gc
13
  import math
14
  import os
 
557
  )
558
 
559
  app.queue(concurrency_count=1)
560
+ app.launch(debug=True, enable_queue=True, share=False)
561
 
562
  if __name__ == "__main__":
563
  seg_track_app()