screenshot-vision-algorithm 0.3.0__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/PKG-INFO +2 -2
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/pyproject.toml +2 -2
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/algorithms/avatar_column.py +2 -1
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/algorithms/speaker_band.py +2 -1
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/algorithms/title_ocr.py +2 -1
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/ocr/avatar_guard.py +2 -1
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/ocr/badge_ocr.py +2 -1
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/ocr/text_ocr_adapter.py +2 -1
- screenshot_vision_algorithm-0.3.1/src/screenshot_vision_algorithm/logging.py +33 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/png_utils.py +2 -1
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm.egg-info/PKG-INFO +2 -2
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm.egg-info/SOURCES.txt +1 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm.egg-info/requires.txt +1 -1
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/README.md +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/setup.cfg +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/__init__.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/_config.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/__init__.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/__init__.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/algorithms/__init__.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/algorithms/badge_detection.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/algorithms/card_bbox.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/algorithms/phash_utils.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/algorithms/template_matching.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/merge/__init__.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/merge/multipage.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/ocr/__init__.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/ocr/nickname_binding.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/profiles/__init__.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/profiles/android.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/profiles/harmony.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/profiles/ios.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/templates/android/8.0.69/chat_back_chevron.png +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/templates/android/8.0.69/chat_input_emoji_smile.png +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/templates/android/8.0.69/chat_input_plus.png +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/templates/android/8.0.69/chat_input_voice.png +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/templates/android/8.0.69/chat_title_more_dots.png +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/templates/android/8.0.69/favorite_label.png +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/templates/android/8.0.69/new_messages_hint_suffix.png +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/templates/android/8.0.69/unread_divider_hint.png +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/templates/android/8.0.69/unread_divider_hint_v2_textonly.png +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/wechat/templates/android/8.0.69/wechat_note_header.png +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/xhs/__init__.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm/android/zhihu/__init__.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm.egg-info/dependency_links.txt +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/src/screenshot_vision_algorithm.egg-info/top_level.txt +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/tests/test_card_bbox.py +0 -0
- {screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/tests/test_package.py +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: screenshot_vision_algorithm
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Multi-platform screenshot vision algorithms: WeChat (card bbox, speaker bands, avatar detection, OCR helpers), XHS & Zhihu (planned)
|
|
5
5
|
License: MIT
|
|
6
6
|
Requires-Python: >=3.10
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist:
|
|
8
|
+
Requires-Dist: structlog>=24.0
|
|
9
9
|
Requires-Dist: numpy>=1.26
|
|
10
10
|
Requires-Dist: opencv-python-headless>=4.10.0
|
|
11
11
|
Provides-Extra: png
|
|
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "screenshot_vision_algorithm"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.1"
|
|
8
8
|
description = "Multi-platform screenshot vision algorithms: WeChat (card bbox, speaker bands, avatar detection, OCR helpers), XHS & Zhihu (planned)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
11
11
|
requires-python = ">=3.10"
|
|
12
12
|
dependencies = [
|
|
13
|
-
"
|
|
13
|
+
"structlog>=24.0",
|
|
14
14
|
"numpy>=1.26",
|
|
15
15
|
"opencv-python-headless>=4.10.0",
|
|
16
16
|
]
|
|
@@ -11,8 +11,9 @@ from dataclasses import dataclass
|
|
|
11
11
|
from typing import Optional
|
|
12
12
|
|
|
13
13
|
import numpy as np
|
|
14
|
-
from
|
|
14
|
+
from screenshot_vision_algorithm.logging import get_logger
|
|
15
15
|
|
|
16
|
+
logger = get_logger(__name__)
|
|
16
17
|
try:
|
|
17
18
|
import cv2
|
|
18
19
|
except ImportError:
|
|
@@ -12,8 +12,9 @@ import numpy as np
|
|
|
12
12
|
from dataclasses import dataclass
|
|
13
13
|
from typing import Literal, Optional
|
|
14
14
|
|
|
15
|
-
from
|
|
15
|
+
from screenshot_vision_algorithm.logging import get_logger
|
|
16
16
|
|
|
17
|
+
logger = get_logger(__name__)
|
|
17
18
|
from screenshot_vision_algorithm.android.wechat.algorithms.template_matching import (
|
|
18
19
|
detect_chat_back_chevron,
|
|
19
20
|
detect_chat_title_more_dots,
|
|
@@ -7,8 +7,9 @@ from typing import Optional
|
|
|
7
7
|
|
|
8
8
|
import cv2 # type: ignore
|
|
9
9
|
import numpy as np # type: ignore
|
|
10
|
-
from
|
|
10
|
+
from screenshot_vision_algorithm.logging import get_logger
|
|
11
11
|
|
|
12
|
+
logger = get_logger(__name__)
|
|
12
13
|
from screenshot_vision_algorithm.android.wechat.algorithms.template_matching import (
|
|
13
14
|
detect_chat_back_chevron,
|
|
14
15
|
detect_chat_title_more_dots,
|
|
@@ -10,8 +10,9 @@ from typing import Any, Literal, Optional
|
|
|
10
10
|
Side = Literal["left", "right"]
|
|
11
11
|
|
|
12
12
|
import numpy as np
|
|
13
|
-
from
|
|
13
|
+
from screenshot_vision_algorithm.logging import get_logger
|
|
14
14
|
|
|
15
|
+
logger = get_logger(__name__)
|
|
15
16
|
try:
|
|
16
17
|
import cv2
|
|
17
18
|
except ImportError:
|
|
@@ -42,8 +42,9 @@ from typing import Optional
|
|
|
42
42
|
|
|
43
43
|
import cv2 # type: ignore
|
|
44
44
|
import numpy as np # type: ignore
|
|
45
|
-
from
|
|
45
|
+
from screenshot_vision_algorithm.logging import get_logger
|
|
46
46
|
|
|
47
|
+
logger = get_logger(__name__)
|
|
47
48
|
from screenshot_vision_algorithm.android.wechat.algorithms.template_matching import UnreadDotHit
|
|
48
49
|
|
|
49
50
|
_DIGIT_RE = re.compile(r"\d+\+?")
|
|
@@ -86,8 +86,9 @@ from pathlib import Path
|
|
|
86
86
|
from typing import TYPE_CHECKING, Callable, Optional, Protocol, runtime_checkable
|
|
87
87
|
|
|
88
88
|
from collector_phone_android_contract import Screenshot
|
|
89
|
-
from
|
|
89
|
+
from screenshot_vision_algorithm.logging import get_logger
|
|
90
90
|
|
|
91
|
+
logger = get_logger(__name__)
|
|
91
92
|
if TYPE_CHECKING: # avoid a hard numpy import at module-load time
|
|
92
93
|
import numpy as np
|
|
93
94
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""结构化日志(structlog,stdlib 集成)。
|
|
2
|
+
|
|
3
|
+
用法::
|
|
4
|
+
|
|
5
|
+
from screenshot_vision_algorithm.logging import get_logger
|
|
6
|
+
logger = get_logger(__name__)
|
|
7
|
+
|
|
8
|
+
logger.info("event_name", key=value)
|
|
9
|
+
logger.info("msg with %s", arg)
|
|
10
|
+
logger.warning("event", exc_info=True)
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import structlog
|
|
14
|
+
|
|
15
|
+
structlog.configure(
|
|
16
|
+
processors=[
|
|
17
|
+
structlog.stdlib.filter_by_level,
|
|
18
|
+
structlog.stdlib.add_logger_name,
|
|
19
|
+
structlog.stdlib.add_log_level,
|
|
20
|
+
structlog.stdlib.PositionalArgumentsFormatter(),
|
|
21
|
+
structlog.processors.TimeStamper(fmt="iso"),
|
|
22
|
+
structlog.dev.ConsoleRenderer(),
|
|
23
|
+
],
|
|
24
|
+
context_class=dict,
|
|
25
|
+
logger_factory=structlog.stdlib.LoggerFactory(),
|
|
26
|
+
wrapper_class=structlog.stdlib.BoundLogger,
|
|
27
|
+
cache_logger_on_first_use=True,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def get_logger(name: str = ""):
|
|
32
|
+
"""返回 structlog logger(stdlib 绑定)。"""
|
|
33
|
+
return structlog.get_logger(name)
|
|
@@ -8,8 +8,9 @@ from __future__ import annotations
|
|
|
8
8
|
import io
|
|
9
9
|
import os
|
|
10
10
|
|
|
11
|
-
from
|
|
11
|
+
from screenshot_vision_algorithm.logging import get_logger
|
|
12
12
|
|
|
13
|
+
logger = get_logger(__name__)
|
|
13
14
|
# OCR ADR:`chat_*` scale 1600;`finalize` 对每帧再用 min(..., screenshot ocr_scale_hint) → resume 仍为 1280。
|
|
14
15
|
DEFAULT_COLLECTOR_UPLOAD_LONG_EDGE_MAX = 1600
|
|
15
16
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: screenshot_vision_algorithm
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Multi-platform screenshot vision algorithms: WeChat (card bbox, speaker bands, avatar detection, OCR helpers), XHS & Zhihu (planned)
|
|
5
5
|
License: MIT
|
|
6
6
|
Requires-Python: >=3.10
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist:
|
|
8
|
+
Requires-Dist: structlog>=24.0
|
|
9
9
|
Requires-Dist: numpy>=1.26
|
|
10
10
|
Requires-Dist: opencv-python-headless>=4.10.0
|
|
11
11
|
Provides-Extra: png
|
|
@@ -2,6 +2,7 @@ README.md
|
|
|
2
2
|
pyproject.toml
|
|
3
3
|
src/screenshot_vision_algorithm/__init__.py
|
|
4
4
|
src/screenshot_vision_algorithm/_config.py
|
|
5
|
+
src/screenshot_vision_algorithm/logging.py
|
|
5
6
|
src/screenshot_vision_algorithm/png_utils.py
|
|
6
7
|
src/screenshot_vision_algorithm.egg-info/PKG-INFO
|
|
7
8
|
src/screenshot_vision_algorithm.egg-info/SOURCES.txt
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/tests/test_card_bbox.py
RENAMED
|
File without changes
|
{screenshot_vision_algorithm-0.3.0 → screenshot_vision_algorithm-0.3.1}/tests/test_package.py
RENAMED
|
File without changes
|