Skip to content

Commit

Permalink
Testing: Dockerfile image on going for OOM
Browse files Browse the repository at this point in the history
  • Loading branch information
insung3511 committed Oct 19, 2023
1 parent e754920 commit a167744
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10.0-slim-buster
FROM python:3.10.9

WORKDIR /app

Expand All @@ -12,9 +12,7 @@ COPY .dockerignore .
COPY . .

RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
RUN export PYTORCH_ENABLE_MPS_FALLBACK=1

ENV SECRET_KEY_FILE=/run/secrets/secret_key.json

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--log-level", "error"]
# CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--log-level", "trace", "--ssl-keyfile=./app/keys/private.key", "--ssl-certfile=./app/keys/certificate.crt", "--ws-max-size", "167772160", "--ws-max-queue", "128"]
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--log-level", "trace", "--ssl-keyfile", "./app/keys/private.key", "--ssl-certfile", "./app/keys/certificate.crt"]
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
EXTRACTOR_THRESHOLD = 0.85

app = FastAPI()
extractor = SkeletonExtractor(pretrained_bool=True, number_of_keypoints=17, device='mps')
extractor = SkeletonExtractor(pretrained_bool=True, number_of_keypoints=17, device='cpu')
preprocessor = DataPreprocessing()
metrics = Metrics()

Expand Down
2 changes: 1 addition & 1 deletion models.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def extract(self, video_tensor: cv2.VideoCapture, score_threshold: float = 0.93,
total_fps += fps
frame_count += 1

pbar.set_postfix({"FPS": f"{fps:.2f}", "Average FPS": f"{total_fps / frame_count:.2f}"})
pbar.set_postfix({"FPS": f"{fps:.2f}", "Average FPS": f"{total_fps / frame_count:.2f}, Skeleton shapes: {len(extracted_skeletons)}"})
pbar.update(1)

pbar.close()
Expand Down

0 comments on commit a167744

Please sign in to comment.