This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def search_faces(self, request: SearchFacesRequest) -> SearchFacesResponse: | |
all_results = [] | |
for query_face in request.query_faces: | |
for model_name in query_face.model_names: | |
collection_name = f"face_embeddings_{model_name.lower()}" | |
# Perform vector similarity search | |
search_results = self._client.search( | |
collection_name=collection_name, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def store_faces(self, request: StoreFacesRequest) -> StoreFacesResponse: | |
stored_count = 0 | |
face_ids = [] | |
for image_faces_data in request.image_faces_data: | |
for face_data in image_faces_data.faces: | |
if face_data.embeddings and face_data.model_names: | |
for model_name in face_data.model_names: | |
face_record = FaceRecord( | |
face_id=f"{uuid.uuid4()}", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This worked almost immediately | |
def _call_analyze_api(self, image_data: bytes) -> Dict[str, Any]: | |
headers = { | |
'Ocp-Apim-Subscription-Key': AZURE_VISION_API_KEY, | |
'Content-Type': 'application/octet-stream' | |
} | |
params = { | |
'features': 'tags,objects,faces,brands,landmarks,celebrities,categories,description,adult,color,imageType', | |
'model-version': 'latest' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This approach never worked despite multiple attempts | |
from azure.ai.vision.imageanalysis import ImageAnalysisClient | |
from azure.core.credentials import AzureKeyCredential | |
client = ImageAnalysisClient( | |
endpoint=AZURE_VISION_ENDPOINT, | |
credential=AzureKeyCredential(AZURE_VISION_API_KEY) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Qdrant collection setup for different embedding models | |
model_sizes = { | |
"VGG-Face": 4096, | |
"Facenet": 128, | |
"ArcFace": 512 | |
} | |
def _ensure_collections_exist(self): | |
for model_name, vector_size in model_sizes.items(): | |
collection_name = f"face_embeddings_{model_name.lower()}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: Service Architecture Guidelines | |
description: Strict Serivice Oriented Architecture | |
globs: | |
alwaysApply: true | |
--- | |
# Service-Oriented Architecture (SOA) Guidelines | |
This project follows a strict Service-Oriented Architecture pattern. All services must adhere to these principles: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of our service architecture | |
class FaceDetectionService: | |
def detect_faces(self, request: FaceDetectionRequest) -> FaceDetectionResponse: | |
# Implementation using DeepFace or Azure Face API | |
pass | |
class ArchiveService: | |
def store_faces(self, request: StoreFacesRequest) -> StoreFacesResponse: | |
# Store face embeddings in Qdrant vector database | |
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#order-details tr").on('click', function(evt) {/*do something*/}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#order-details").on('click', ‘tr’, function(evt) {/*do something*/}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#order-details").on('click', ‘tr’, function(evt) {/*do something*/}); |
NewerOlder