auto-commit to deploy afsar
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,4 +3,5 @@ venv
|
||||
*.jpg
|
||||
.idea
|
||||
src/models
|
||||
*.pyc
|
||||
*.pyc
|
||||
.DS_Store
|
||||
@@ -8,6 +8,8 @@ services:
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
runtime: nvidia
|
||||
devices:
|
||||
- "/dev/video0:/dev/video0"
|
||||
# ports:
|
||||
# - "9999:9999"
|
||||
# environment:
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user