auto-commit to deploy afsar

This commit is contained in:
ALIHAN DIKEL
2024-05-05 00:08:47 +03:00
parent c223a43466
commit f2fc0524d5
3 changed files with 7 additions and 2 deletions

3
.gitignore vendored
View File

@@ -3,4 +3,5 @@ venv
*.jpg
.idea
src/models
*.pyc
*.pyc
.DS_Store

View File

@@ -8,6 +8,8 @@ services:
dockerfile: Dockerfile
restart: unless-stopped
runtime: nvidia
devices:
- "/dev/video0:/dev/video0"
# ports:
# - "9999:9999"
# environment:

View File

@@ -1,9 +1,11 @@
import datetime
import os
import cv2
import numpy as np
import io
class CameraService:
def capture_image(self):
# Access the webcam (usually webcam is at index 0 or -1)
@@ -16,7 +18,7 @@ class CameraService:
# Save the image to a file in the tmp directory with a timestamp
timestamp = datetime.datetime.now().strftime("%Y%m%d-%H%M")
filename = f"/Users/tcudikel/Dev/agent-home-security/tmp/archive/image_{timestamp}.jpg"
filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), f"tmp/archive/image_{timestamp}.jpg")
with open(filename, 'wb') as f:
f.write(byte_im)