ref: use poetry

This commit is contained in:
alikia2x (寒寒) 2024-08-10 17:38:57 +08:00
parent ab947aec6e
commit 06d52437f3
Signed by: alikia2x
GPG Key ID: 56209E0CCD8420C6
13 changed files with 4849 additions and 14 deletions

View File

@ -1 +0,0 @@
3.11

View File

@ -4,11 +4,11 @@ import numpy as np
from flask import Flask, render_template_string, request, send_from_directory
from jinja2 import BaseLoader
from openrecall.config import appdata_folder, screenshots_path
from openrecall.database import create_db, get_all_entries, get_timestamps
from openrecall.nlp import cosine_similarity, get_embedding
from openrecall.screenshot import record_screenshots_thread
from openrecall.utils import human_readable_time, timestamp_to_human_readable
from openrewind.config import appdata_folder, screenshots_path
from openrewind.database import create_db, get_all_entries, get_timestamps
from openrewind.nlp import cosine_similarity, get_embedding
from openrewind.screenshot import record_screenshots_thread
from openrewind.utils import human_readable_time, timestamp_to_human_readable
app = Flask(__name__)

View File

@ -2,7 +2,7 @@ import sqlite3
from collections import namedtuple
from typing import Any, List
from openrecall.config import db_path
from openrewind.config import db_path
Entry = namedtuple("Entry", ["id", "app", "title", "text", "timestamp", "embedding"])

View File

@ -5,11 +5,11 @@ import mss
import numpy as np
from PIL import Image
from openrecall.config import screenshots_path, args
from openrecall.database import insert_entry
from openrecall.nlp import get_embedding
from openrecall.ocr import extract_text_from_image
from openrecall.utils import get_active_app_name, get_active_window_title, is_user_active
from openrewind.config import screenshots_path, args
from openrewind.database import insert_entry
from openrewind.nlp import get_embedding
from openrewind.ocr import extract_text_from_image
from openrewind.utils import get_active_app_name, get_active_window_title, is_user_active
def mean_structured_similarity_index(img1, img2, L=255):

4807
poetry.lock generated Normal file

File diff suppressed because one or more lines are too long

29
pyproject.toml Normal file
View File

@ -0,0 +1,29 @@
[tool.poetry]
name = "openrewind"
version = "0.1.0"
description = ""
authors = ["alikia2x <alikia2x@outlook.com>"]
license = "AGPL"
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.11"
Flask = "3.0.3"
numpy = "1.26.4"
mss = "9.0.1"
sentence-transformers = "3.0.0"
torch = "2.2.0"
torchvision = "0.17.0"
shapely = "2.0.4"
h5py = "3.11.0"
rapidfuzz = "3.9.3"
Pillow = "10.3.0"
pyobjc = {version="^10.3.1", markers="sys_platform=='darwin'"}
pywin32 = {version="^306", markers="sys_platform=='windows'"}
psutil = {version="^5.9.0", markers="sys_platform=='windows'"}
python-doctr = "^0.9.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

View File

@ -1,6 +1,6 @@
import pytest
from unittest import mock
from openrecall.config import get_appdata_folder
from openrewind.config import get_appdata_folder
def test_get_appdata_folder_windows(tmp_path):
with mock.patch('sys.platform', 'win32'):

View File

@ -1,6 +1,6 @@
import pytest
import numpy as np
from openrecall.nlp import cosine_similarity
from openrewind.nlp import cosine_similarity
def test_cosine_similarity_identical_vectors():
a = np.array([1, 0, 0])