pymtcnn 1.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.
- pymtcnn-1.1.0/.github/workflows/publish.yml +43 -0
- pymtcnn-1.1.0/.gitignore +91 -0
- pymtcnn-1.1.0/GITHUB_SETUP.md +189 -0
- pymtcnn-1.1.0/LICENSE +47 -0
- pymtcnn-1.1.0/MANIFEST.in +25 -0
- pymtcnn-1.1.0/PKG-INFO +355 -0
- pymtcnn-1.1.0/PYPI_PUBLICATION_GUIDE.md +302 -0
- pymtcnn-1.1.0/README.md +307 -0
- pymtcnn-1.1.0/SETUP_COMMANDS.sh +94 -0
- pymtcnn-1.1.0/docs/OPTIMIZATION_JOURNEY.md +361 -0
- pymtcnn-1.1.0/examples/batch_processing.py +136 -0
- pymtcnn-1.1.0/examples/s1_integration_example.py +262 -0
- pymtcnn-1.1.0/examples/single_frame_detection.py +105 -0
- pymtcnn-1.1.0/pymtcnn/__init__.py +65 -0
- pymtcnn-1.1.0/pymtcnn/backends/__init__.py +12 -0
- pymtcnn-1.1.0/pymtcnn/backends/coreml_backend.py +716 -0
- pymtcnn-1.1.0/pymtcnn/backends/onnx_backend.py +423 -0
- pymtcnn-1.1.0/pymtcnn/base.py +419 -0
- pymtcnn-1.1.0/pymtcnn/detector.py +206 -0
- pymtcnn-1.1.0/pymtcnn/models/onet.onnx +0 -0
- pymtcnn-1.1.0/pymtcnn/models/onet_fp32.mlpackage/Data/com.apple.CoreML/model.mlmodel +0 -0
- pymtcnn-1.1.0/pymtcnn/models/onet_fp32.mlpackage/Data/com.apple.CoreML/weights/weight.bin +0 -0
- pymtcnn-1.1.0/pymtcnn/models/pnet.onnx +0 -0
- pymtcnn-1.1.0/pymtcnn/models/pnet_fp32.mlpackage/Data/com.apple.CoreML/model.mlmodel +0 -0
- pymtcnn-1.1.0/pymtcnn/models/pnet_fp32.mlpackage/Data/com.apple.CoreML/weights/weight.bin +0 -0
- pymtcnn-1.1.0/pymtcnn/models/rnet.onnx +0 -0
- pymtcnn-1.1.0/pymtcnn/models/rnet_fp32.mlpackage/Data/com.apple.CoreML/model.mlmodel +0 -0
- pymtcnn-1.1.0/pymtcnn/models/rnet_fp32.mlpackage/Data/com.apple.CoreML/weights/weight.bin +0 -0
- pymtcnn-1.1.0/pymtcnn.egg-info/PKG-INFO +355 -0
- pymtcnn-1.1.0/pymtcnn.egg-info/SOURCES.txt +37 -0
- pymtcnn-1.1.0/pymtcnn.egg-info/dependency_links.txt +1 -0
- pymtcnn-1.1.0/pymtcnn.egg-info/not-zip-safe +1 -0
- pymtcnn-1.1.0/pymtcnn.egg-info/requires.txt +22 -0
- pymtcnn-1.1.0/pymtcnn.egg-info/top_level.txt +1 -0
- pymtcnn-1.1.0/pyproject.toml +75 -0
- pymtcnn-1.1.0/requirements.txt +3 -0
- pymtcnn-1.1.0/setup.cfg +4 -0
- pymtcnn-1.1.0/setup.py +78 -0
- pymtcnn-1.1.0/test_backends.py +92 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch: # Allow manual trigger
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
name: Build and publish to PyPI
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
id-token: write # Required for trusted publishing
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout code
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: '3.10'
|
|
24
|
+
|
|
25
|
+
- name: Install build dependencies
|
|
26
|
+
run: |
|
|
27
|
+
python -m pip install --upgrade pip
|
|
28
|
+
pip install build twine
|
|
29
|
+
|
|
30
|
+
- name: Build package
|
|
31
|
+
run: python -m build
|
|
32
|
+
|
|
33
|
+
- name: Check distribution
|
|
34
|
+
run: twine check dist/*
|
|
35
|
+
|
|
36
|
+
- name: Publish to PyPI
|
|
37
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
38
|
+
|
|
39
|
+
- name: Upload build artifacts
|
|
40
|
+
uses: actions/upload-artifact@v4
|
|
41
|
+
with:
|
|
42
|
+
name: dist-packages
|
|
43
|
+
path: dist/
|
pymtcnn-1.1.0/.gitignore
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
|
|
8
|
+
# Distribution / packaging
|
|
9
|
+
build/
|
|
10
|
+
develop-eggs/
|
|
11
|
+
dist/
|
|
12
|
+
downloads/
|
|
13
|
+
eggs/
|
|
14
|
+
.eggs/
|
|
15
|
+
lib/
|
|
16
|
+
lib64/
|
|
17
|
+
parts/
|
|
18
|
+
sdist/
|
|
19
|
+
var/
|
|
20
|
+
wheels/
|
|
21
|
+
pip-wheel-metadata/
|
|
22
|
+
share/python-wheels/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
.installed.cfg
|
|
25
|
+
*.egg
|
|
26
|
+
MANIFEST
|
|
27
|
+
|
|
28
|
+
# PyInstaller
|
|
29
|
+
*.manifest
|
|
30
|
+
*.spec
|
|
31
|
+
|
|
32
|
+
# Installer logs
|
|
33
|
+
pip-log.txt
|
|
34
|
+
pip-delete-this-directory.txt
|
|
35
|
+
|
|
36
|
+
# Unit test / coverage reports
|
|
37
|
+
htmlcov/
|
|
38
|
+
.tox/
|
|
39
|
+
.nox/
|
|
40
|
+
.coverage
|
|
41
|
+
.coverage.*
|
|
42
|
+
.cache
|
|
43
|
+
nosetests.xml
|
|
44
|
+
coverage.xml
|
|
45
|
+
*.cover
|
|
46
|
+
*.py,cover
|
|
47
|
+
.hypothesis/
|
|
48
|
+
.pytest_cache/
|
|
49
|
+
|
|
50
|
+
# Jupyter Notebook
|
|
51
|
+
.ipynb_checkpoints
|
|
52
|
+
|
|
53
|
+
# IPython
|
|
54
|
+
profile_default/
|
|
55
|
+
ipython_config.py
|
|
56
|
+
|
|
57
|
+
# pyenv
|
|
58
|
+
.python-version
|
|
59
|
+
|
|
60
|
+
# Environments
|
|
61
|
+
.env
|
|
62
|
+
.venv
|
|
63
|
+
env/
|
|
64
|
+
venv/
|
|
65
|
+
ENV/
|
|
66
|
+
env.bak/
|
|
67
|
+
venv.bak/
|
|
68
|
+
|
|
69
|
+
# IDEs
|
|
70
|
+
.vscode/
|
|
71
|
+
.idea/
|
|
72
|
+
*.swp
|
|
73
|
+
*.swo
|
|
74
|
+
*~
|
|
75
|
+
.DS_Store
|
|
76
|
+
|
|
77
|
+
# mypy
|
|
78
|
+
.mypy_cache/
|
|
79
|
+
.dmypy.json
|
|
80
|
+
dmypy.json
|
|
81
|
+
|
|
82
|
+
# Pyre type checker
|
|
83
|
+
.pyre/
|
|
84
|
+
|
|
85
|
+
# Test files
|
|
86
|
+
test_image.jpg
|
|
87
|
+
test_video.mp4
|
|
88
|
+
output_*.jpg
|
|
89
|
+
cache/
|
|
90
|
+
*.json
|
|
91
|
+
detections_for_pyfaceau.json
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# GitHub Repository Setup for PyMTCNN
|
|
2
|
+
|
|
3
|
+
## Step 1: Create GitHub Repository
|
|
4
|
+
|
|
5
|
+
1. Go to https://github.com/new
|
|
6
|
+
2. Settings:
|
|
7
|
+
- Name: `PyMTCNN`
|
|
8
|
+
- Description: `High-performance MTCNN face detection optimized for Apple Neural Engine - 34.26 FPS`
|
|
9
|
+
- Public
|
|
10
|
+
- Do NOT initialize with README, .gitignore, or license
|
|
11
|
+
|
|
12
|
+
3. Click "Create repository"
|
|
13
|
+
|
|
14
|
+
## Step 2: Initialize Git and Push
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
cd /Users/johnwilsoniv/Documents/SplitFace\ Open3/pymtcnn
|
|
18
|
+
|
|
19
|
+
# Initialize git repo
|
|
20
|
+
git init
|
|
21
|
+
git add .
|
|
22
|
+
git commit -m "Initial commit - PyMTCNN v1.0.0"
|
|
23
|
+
|
|
24
|
+
# Add remote (replace YOUR-USERNAME with your GitHub username)
|
|
25
|
+
git remote add origin https://github.com/YOUR-USERNAME/PyMTCNN.git
|
|
26
|
+
|
|
27
|
+
# Push to GitHub
|
|
28
|
+
git branch -M main
|
|
29
|
+
git push -u origin main
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Step 3: Update Package Metadata with Correct URLs
|
|
33
|
+
|
|
34
|
+
After creating the repo, update these files with your actual GitHub username:
|
|
35
|
+
|
|
36
|
+
### Update `setup.py`:
|
|
37
|
+
```python
|
|
38
|
+
url="https://github.com/YOUR-USERNAME/PyMTCNN",
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Update `pyproject.toml`:
|
|
42
|
+
```toml
|
|
43
|
+
[project.urls]
|
|
44
|
+
Homepage = "https://github.com/YOUR-USERNAME/PyMTCNN"
|
|
45
|
+
Documentation = "https://github.com/YOUR-USERNAME/PyMTCNN/blob/main/README.md"
|
|
46
|
+
Repository = "https://github.com/YOUR-USERNAME/PyMTCNN"
|
|
47
|
+
"Bug Tracker" = "https://github.com/YOUR-USERNAME/PyMTCNN/issues"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Then commit and push the changes:
|
|
51
|
+
```bash
|
|
52
|
+
git add setup.py pyproject.toml
|
|
53
|
+
git commit -m "Update GitHub URLs"
|
|
54
|
+
git push
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Step 4: Link PyPI to GitHub (Optional but Recommended)
|
|
58
|
+
|
|
59
|
+
### Option A: Manual Setup (Simple)
|
|
60
|
+
|
|
61
|
+
Your PyPI package will automatically link to GitHub if the URLs in `setup.py` and `pyproject.toml` are correct. When you upload to PyPI, it will show:
|
|
62
|
+
- Homepage link → Your GitHub repo
|
|
63
|
+
- Source code link → Your GitHub repo
|
|
64
|
+
- Bug tracker link → GitHub issues
|
|
65
|
+
|
|
66
|
+
**That's it!** The metadata in your package does the linking.
|
|
67
|
+
|
|
68
|
+
### Option B: GitHub Actions for Automated Publishing (Advanced)
|
|
69
|
+
|
|
70
|
+
If you want to automatically publish to PyPI when you create a GitHub release:
|
|
71
|
+
|
|
72
|
+
1. **Add PyPI API token to GitHub Secrets**:
|
|
73
|
+
- Go to your PyMTCNN repo on GitHub
|
|
74
|
+
- Settings → Secrets and variables → Actions
|
|
75
|
+
- Click "New repository secret"
|
|
76
|
+
- Name: `PYPI_API_TOKEN`
|
|
77
|
+
- Value: Your PyPI API token (starts with `pypi-...`)
|
|
78
|
+
- Click "Add secret"
|
|
79
|
+
|
|
80
|
+
2. **Create GitHub Actions workflow**:
|
|
81
|
+
|
|
82
|
+
Create `.github/workflows/publish.yml`:
|
|
83
|
+
|
|
84
|
+
```yaml
|
|
85
|
+
name: Publish to PyPI
|
|
86
|
+
|
|
87
|
+
on:
|
|
88
|
+
release:
|
|
89
|
+
types: [published]
|
|
90
|
+
|
|
91
|
+
jobs:
|
|
92
|
+
publish:
|
|
93
|
+
runs-on: ubuntu-latest
|
|
94
|
+
steps:
|
|
95
|
+
- uses: actions/checkout@v3
|
|
96
|
+
|
|
97
|
+
- name: Set up Python
|
|
98
|
+
uses: actions/setup-python@v4
|
|
99
|
+
with:
|
|
100
|
+
python-version: '3.10'
|
|
101
|
+
|
|
102
|
+
- name: Install dependencies
|
|
103
|
+
run: |
|
|
104
|
+
python -m pip install --upgrade pip
|
|
105
|
+
pip install build twine
|
|
106
|
+
|
|
107
|
+
- name: Build package
|
|
108
|
+
run: python -m build
|
|
109
|
+
|
|
110
|
+
- name: Publish to PyPI
|
|
111
|
+
env:
|
|
112
|
+
TWINE_USERNAME: __token__
|
|
113
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
114
|
+
run: twine upload dist/*
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
3. **How it works**:
|
|
118
|
+
- Create a GitHub release (e.g., v1.0.1)
|
|
119
|
+
- GitHub Actions automatically builds and uploads to PyPI
|
|
120
|
+
- No manual `twine upload` needed!
|
|
121
|
+
|
|
122
|
+
### Option C: Link Existing PyPI Package to GitHub
|
|
123
|
+
|
|
124
|
+
If you've already published to PyPI:
|
|
125
|
+
|
|
126
|
+
1. Log in to https://pypi.org
|
|
127
|
+
2. Go to your project: https://pypi.org/project/pymtcnn/
|
|
128
|
+
3. Click "Manage" → "Settings"
|
|
129
|
+
4. The links should already be there from your package metadata
|
|
130
|
+
5. If not, you can rebuild and re-upload with updated metadata
|
|
131
|
+
|
|
132
|
+
## Step 5: Create First Release
|
|
133
|
+
|
|
134
|
+
After pushing to GitHub:
|
|
135
|
+
|
|
136
|
+
1. Go to your repo: https://github.com/YOUR-USERNAME/PyMTCNN
|
|
137
|
+
2. Click "Releases" → "Create a new release"
|
|
138
|
+
3. Tag: `v1.0.0`
|
|
139
|
+
4. Title: `PyMTCNN v1.0.0 - High-Performance Face Detection`
|
|
140
|
+
5. Description:
|
|
141
|
+
```markdown
|
|
142
|
+
# PyMTCNN v1.0.0
|
|
143
|
+
|
|
144
|
+
High-performance MTCNN face detection optimized for Apple Neural Engine.
|
|
145
|
+
|
|
146
|
+
## Installation
|
|
147
|
+
```bash
|
|
148
|
+
pip install pymtcnn
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Performance
|
|
152
|
+
- 34.26 FPS with batch processing
|
|
153
|
+
- 175.7x speedup over baseline
|
|
154
|
+
- 95% IoU accuracy
|
|
155
|
+
|
|
156
|
+
## Links
|
|
157
|
+
- PyPI: https://pypi.org/project/pymtcnn/
|
|
158
|
+
- Documentation: [README.md](README.md)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
6. Attach files (optional):
|
|
162
|
+
- `dist/pymtcnn-1.0.0-py3-none-any.whl`
|
|
163
|
+
- `dist/pymtcnn-1.0.0.tar.gz`
|
|
164
|
+
|
|
165
|
+
7. Click "Publish release"
|
|
166
|
+
|
|
167
|
+
## What You Get
|
|
168
|
+
|
|
169
|
+
After setup, your PyPI page will show:
|
|
170
|
+
- ✅ Homepage link to GitHub
|
|
171
|
+
- ✅ Source code link to GitHub
|
|
172
|
+
- ✅ Bug tracker link to GitHub Issues
|
|
173
|
+
- ✅ Automatic README rendering from PyPI
|
|
174
|
+
- ✅ Download badges
|
|
175
|
+
- ✅ License information
|
|
176
|
+
|
|
177
|
+
## Quick Summary
|
|
178
|
+
|
|
179
|
+
**For basic linking** (recommended):
|
|
180
|
+
1. Create GitHub repo named `PyMTCNN`
|
|
181
|
+
2. Push pymtcnn code to it
|
|
182
|
+
3. Update `setup.py` and `pyproject.toml` with correct GitHub URLs
|
|
183
|
+
4. Upload to PyPI with `twine upload dist/*`
|
|
184
|
+
5. PyPI automatically links to GitHub!
|
|
185
|
+
|
|
186
|
+
**For automated publishing** (optional):
|
|
187
|
+
- Add GitHub Actions workflow
|
|
188
|
+
- Add PyPI token to GitHub Secrets
|
|
189
|
+
- Create releases on GitHub → auto-publishes to PyPI
|
pymtcnn-1.1.0/LICENSE
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 SplitFace
|
|
4
|
+
|
|
5
|
+
This work is licensed under the Creative Commons Attribution-NonCommercial 4.0
|
|
6
|
+
International License. To view a copy of this license, visit
|
|
7
|
+
http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
|
|
8
|
+
Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
|
|
9
|
+
|
|
10
|
+
================================================================================
|
|
11
|
+
|
|
12
|
+
You are free to:
|
|
13
|
+
|
|
14
|
+
* Share — copy and redistribute the material in any medium or format
|
|
15
|
+
* Adapt — remix, transform, and build upon the material
|
|
16
|
+
|
|
17
|
+
The licensor cannot revoke these freedoms as long as you follow the license terms.
|
|
18
|
+
|
|
19
|
+
================================================================================
|
|
20
|
+
|
|
21
|
+
Under the following terms:
|
|
22
|
+
|
|
23
|
+
* Attribution — You must give appropriate credit, provide a link to the
|
|
24
|
+
license, and indicate if changes were made. You may do so in any reasonable
|
|
25
|
+
manner, but not in any way that suggests the licensor endorses you or your use.
|
|
26
|
+
|
|
27
|
+
* NonCommercial — You may not use the material for commercial purposes.
|
|
28
|
+
|
|
29
|
+
* No additional restrictions — You may not apply legal terms or technological
|
|
30
|
+
measures that legally restrict others from doing anything the license permits.
|
|
31
|
+
|
|
32
|
+
================================================================================
|
|
33
|
+
|
|
34
|
+
Notices:
|
|
35
|
+
|
|
36
|
+
You do not have to comply with the license for elements of the material in the
|
|
37
|
+
public domain or where your use is permitted by an applicable exception or
|
|
38
|
+
limitation.
|
|
39
|
+
|
|
40
|
+
No warranties are given. The license may not give you all of the permissions
|
|
41
|
+
necessary for your intended use. For example, other rights such as publicity,
|
|
42
|
+
privacy, or moral rights may limit how you use the material.
|
|
43
|
+
|
|
44
|
+
================================================================================
|
|
45
|
+
|
|
46
|
+
Full legal code available at:
|
|
47
|
+
https://creativecommons.org/licenses/by-nc/4.0/legalcode
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Include documentation
|
|
2
|
+
include README.md
|
|
3
|
+
include LICENSE
|
|
4
|
+
include requirements.txt
|
|
5
|
+
|
|
6
|
+
# Include documentation folder
|
|
7
|
+
recursive-include docs *.md
|
|
8
|
+
|
|
9
|
+
# Include examples
|
|
10
|
+
recursive-include examples *.py
|
|
11
|
+
|
|
12
|
+
# Include CoreML models (all files in .mlpackage bundles)
|
|
13
|
+
recursive-include pymtcnn/models *.mlpackage/*
|
|
14
|
+
recursive-include pymtcnn/models *.mlmodel
|
|
15
|
+
recursive-include pymtcnn/models *.bin
|
|
16
|
+
recursive-include pymtcnn/models Manifest.json
|
|
17
|
+
|
|
18
|
+
# Include ONNX models
|
|
19
|
+
include pymtcnn/models/*.onnx
|
|
20
|
+
|
|
21
|
+
# Exclude compiled Python files
|
|
22
|
+
global-exclude __pycache__
|
|
23
|
+
global-exclude *.py[cod]
|
|
24
|
+
global-exclude *.so
|
|
25
|
+
global-exclude .DS_Store
|