Skip to content

Commit

Permalink
Add index service
Browse files Browse the repository at this point in the history
  • Loading branch information
hv0905 committed Dec 29, 2023
1 parent aae4beb commit e033942
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
4 changes: 1 addition & 3 deletions app/Services/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@


def verify_access_token(token: str | None) -> bool:
if not config.access_protected:
return True
return token is not None and token == config.access_token
return (not config.access_protected) or (token is not None and token == config.access_token)


def permissive_access_token_verify(
Expand Down
17 changes: 17 additions & 0 deletions app/Services/index_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from PIL import Image

from app.Models.img_data import ImageData
from app.Services import TransformersService
from app.Services.ocr_services import OCRService


class IndexService:
def __init__(self, ocr_service: OCRService, transformers_service: TransformersService):
self._ocr_service = ocr_service
self._transformers_service = transformers_service

def _calculate_vectors(self):
pass

def index_image(self, image: Image.Image, image_data: ImageData):
pass
4 changes: 4 additions & 0 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Requirements for development and testing

pytest
pylint

0 comments on commit e033942

Please sign in to comment.