ydl2 0.1.0__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.
ydl2-0.1.0/LICENSE ADDED
File without changes
ydl2-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.4
2
+ Name: ydl2
3
+ Version: 0.1.0
4
+ Summary: 无敌的杨
5
+ Author-email: 无敌的杨 <ydl779762225@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/CiweiWenruo/ydl2
8
+ Requires-Python: >=3.8
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: numpy>=1.21
12
+ Requires-Dist: opencv-python>=4.6
13
+ Dynamic: license-file
14
+
15
+ # ydl
16
+
17
+ `ydl2` 是一个对 `cv2` 的轻量二次封装工具包,用于日常计算机视觉工程中**反复出现但 cv2 没直接提供的功能**。
18
+
19
+ ## 安装
20
+
21
+ ```bash
22
+ pip install ydl2
ydl2-0.1.0/README.md ADDED
@@ -0,0 +1,8 @@
1
+ # ydl
2
+
3
+ `ydl2` 是一个对 `cv2` 的轻量二次封装工具包,用于日常计算机视觉工程中**反复出现但 cv2 没直接提供的功能**。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ pip install ydl2
@@ -0,0 +1,22 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "ydl2"
7
+ version = "0.1.0"
8
+ description = "无敌的杨"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ {name = "无敌的杨", email = "ydl779762225@gmail.com"}
14
+ ]
15
+
16
+ dependencies = [
17
+ "numpy>=1.21",
18
+ "opencv-python>=4.6"
19
+ ]
20
+
21
+ [project.urls]
22
+ Homepage = "https://github.com/CiweiWenruo/ydl2"
ydl2-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,6 @@
1
+ from .cn import imwrite,imread
2
+
3
+ __all__ = [
4
+ "imwrite",
5
+ "imread",
6
+ ]
@@ -0,0 +1,40 @@
1
+ import os
2
+ import cv2
3
+ import numpy as np
4
+
5
+
6
+ def imread(path, flags=cv2.IMREAD_UNCHANGED):
7
+ """
8
+ Unicode-safe image read (supports Chinese paths on Windows)
9
+ """
10
+ if not isinstance(path, str):
11
+ raise TypeError("[imread] path must be str")
12
+
13
+ if not os.path.exists(path):
14
+ raise FileNotFoundError(f"[imread] file not exists: {path}")
15
+
16
+ data = np.fromfile(path, dtype=np.uint8)
17
+ img = cv2.imdecode(data, flags)
18
+
19
+ if img is None:
20
+ raise RuntimeError(f"[imread] cv2.imdecode failed: {path}")
21
+
22
+ return img
23
+
24
+
25
+ def imwrite(path, img):
26
+ """
27
+ Unicode-safe image write
28
+ """
29
+ if img is None:
30
+ raise ValueError("[imwrite] img is None")
31
+
32
+ ext = os.path.splitext(path)[1].lower()
33
+ if ext == "":
34
+ raise ValueError("[imwrite] file extension is required")
35
+
36
+ success, buf = cv2.imencode(ext, img)
37
+ if not success:
38
+ raise RuntimeError(f"[imwrite] cv2.imencode failed: {path}")
39
+
40
+ buf.tofile(path)
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.4
2
+ Name: ydl2
3
+ Version: 0.1.0
4
+ Summary: 无敌的杨
5
+ Author-email: 无敌的杨 <ydl779762225@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/CiweiWenruo/ydl2
8
+ Requires-Python: >=3.8
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: numpy>=1.21
12
+ Requires-Dist: opencv-python>=4.6
13
+ Dynamic: license-file
14
+
15
+ # ydl
16
+
17
+ `ydl2` 是一个对 `cv2` 的轻量二次封装工具包,用于日常计算机视觉工程中**反复出现但 cv2 没直接提供的功能**。
18
+
19
+ ## 安装
20
+
21
+ ```bash
22
+ pip install ydl2
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/ydl2/__init__.py
5
+ src/ydl2/cn.py
6
+ src/ydl2.egg-info/PKG-INFO
7
+ src/ydl2.egg-info/SOURCES.txt
8
+ src/ydl2.egg-info/dependency_links.txt
9
+ src/ydl2.egg-info/requires.txt
10
+ src/ydl2.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ numpy>=1.21
2
+ opencv-python>=4.6
@@ -0,0 +1 @@
1
+ ydl2