Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6b202d9
build(deps): update scikit-learn requirement in /requirements
dependabot[bot] Jun 1, 2026
62ec55f
build(deps): update opencv-python requirement in /requirements
dependabot[bot] Jun 1, 2026
fbd8167
build(deps): update tqdm requirement in /requirements
dependabot[bot] Jun 1, 2026
444f825
build(deps): update scikit-image requirement in /requirements
dependabot[bot] Jun 1, 2026
30bc195
build(deps): update tensorboard requirement in /requirements
dependabot[bot] Jun 1, 2026
032dd00
ci: upgrade Python from 3.8 to 3.10+ in CI workflows
Pillar1989 Jun 2, 2026
5c45ff9
fix: ruff CLI syntax and setuptools compatibility for Python 3.10
Pillar1989 Jun 2, 2026
9bd5376
fix: pin ruff to <0.5 to avoid new lint rules with Python 3.10
Pillar1989 Jun 2, 2026
a9f8764
fix: pin ruff to 0.0.x series and fix ethos-u-vela build isolation
Pillar1989 Jun 2, 2026
8ed2213
fix: auto-fix 12 ruff lint errors and constrain ethos-u-vela
Pillar1989 Jun 2, 2026
1849ce5
fix: pin albumentations<1.4 and numpy<2.0 for Python 3.10 compat
Pillar1989 Jun 2, 2026
fb83425
fix: compat shim for IAAAdditiveGaussianNoise in albumentations>=1.4
Pillar1989 Jun 2, 2026
a65a1bc
fix: use PyTorch mirror for MNIST download
Pillar1989 Jun 2, 2026
746732d
fix: replace removed pnnx.wrapper module with inline implementation
Pillar1989 Jun 2, 2026
a88fcfe
fix: adapt export_pnnx to new pnnx package layout
Pillar1989 Jun 2, 2026
4ded7f8
fix: remove unused osp import in export_pnnx
Pillar1989 Jun 2, 2026
b921d4b
Merge remote-tracking branch 'origin/dependabot/pip/requirements/dev/…
Pillar1989 Jun 2, 2026
3f8462b
Merge remote-tracking branch 'origin/dependabot/pip/requirements/dev/…
Pillar1989 Jun 2, 2026
b5bfe8c
Merge remote-tracking branch 'origin/dependabot/pip/requirements/dev/…
Pillar1989 Jun 2, 2026
1f994be
merge: resolve conflict in base.txt (keep both dep updates)
Pillar1989 Jun 2, 2026
51e3793
merge: resolve conflict in base.txt (tensorboard + tqdm)
Pillar1989 Jun 2, 2026
51bac98
fix: pin scikit-image<0.26, requires Python>=3.11
Pillar1989 Jun 2, 2026
30d9ecb
Switch CI Python version from 3.10 to 3.11
Pillar1989 Jun 2, 2026
aacff32
fix: use --no-build-isolation for all pip installs
Pillar1989 Jun 2, 2026
f1bff08
fix: pin opencv-python<4.10 for numpy<2.0 compat
Pillar1989 Jun 2, 2026
bc5ab0b
Revert ruff auto-fix changes to model files
Pillar1989 Jun 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/code-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.11'
cache: 'pip'

- name: install dependencies
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/functional-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
os:
- ubuntu-latest
python-version:
- '3.8'
- '3.11'
task:
- classification
- detection
Expand All @@ -67,14 +67,15 @@ jobs:

- name: pip install deps
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install --upgrade pip wheel "setuptools>=65.5,<70"
python -m pip install torch==2.0.0+cpu torchvision==0.15.1+cpu torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cpu
python -m pip install -r requirements/pytorch_cpu.txt
python -m pip install -r requirements/base.txt
python -m pip install -r requirements/inference.txt
python -m pip install -r requirements/export.txt
python -m mim install -r requirements/mmlab.txt
python -m mim install -e .
python -m pip install --no-build-isolation -r requirements/pytorch_cpu.txt
python -m pip install --no-build-isolation -r requirements/base.txt
python -m pip install --no-build-isolation -r requirements/inference.txt
python -m pip install --no-build-isolation -r requirements/export.txt
echo "ethos-u-vela>=5.0.0" > /tmp/pip-constraints.txt
PIP_CONSTRAINT=/tmp/pip-constraints.txt python -m mim install -r requirements/mmlab.txt
PIP_CONSTRAINT=/tmp/pip-constraints.txt python -m mim install -e .
python --version
python -m pip --version
python -m pip list
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
- ubuntu-latest
- windows-latest
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
defaults:
run:
shell: bash -l {0}
Expand All @@ -53,11 +53,11 @@ jobs:

- name: pip install deps (CPU)
run: |
python3 -m pip install --upgrade pip wheel setuptools
python3 -m pip install -r requirements/pytorch_cpu.txt
python3 -m pip install -r requirements/base.txt
python3 -m pip install -r requirements/inference.txt
python3 -m pip install -r requirements/export.txt
python3 -m pip install --upgrade pip wheel "setuptools>=65.5,<70"
python3 -m pip install --no-build-isolation -r requirements/pytorch_cpu.txt
python3 -m pip install --no-build-isolation -r requirements/base.txt
python3 -m pip install --no-build-isolation -r requirements/inference.txt
python3 -m pip install --no-build-isolation -r requirements/export.txt
python3 -m mim install -r requirements/mmlab.txt
python3 -m mim install -e .
python3 --version
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,9 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
target-version = "py38"


[tool.ruff.per-file-ignores]
"sscma/models/backbones/MobileNetv4.py" = ["F401", "F821", "F841"]
"sscma/models/layers/nn_blocks.py" = ["F401", "F841"]

[tool.ruff.mccabe]
max-complexity = 10
12 changes: 6 additions & 6 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ libusb1

# sensor
cbor
numpy>=1.23.5
numpy>=1.23.5,<2.0


# vision
opencv-python>=4.9.0.80
opencv-python>=4.9.0.80,<4.10


# openmmlab package manager
Expand All @@ -18,17 +18,17 @@ packaging>=23.1
pandas>=2.0.0
pillow>=9.4.0
pyyaml>=6.0
scikit-image>=0.20.0
scikit-learn>=1.2.2
scikit-image>=0.26.0
scikit-learn>=1.8.0


# sound
soundfile>=0.12.1


# visualize
tensorboard>=2.12.3
tqdm>=4.65.0
tensorboard>=2.20.0
tqdm>=4.67.3


# data
Expand Down
2 changes: 1 addition & 1 deletion requirements/tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black>=23.3.0
isort>=5.12.0
pre-commit>=3.3.3
ruff>=0.0.275
ruff>=0.0.275,<0.1.0
2 changes: 1 addition & 1 deletion sscma/datasets/mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class MNIST(BaseDataset):
**kwargs: Other keyword arguments in :class:`BaseDataset`.
""" # noqa: E501

url_prefix = 'http://yann.lecun.com/exdb/mnist/'
url_prefix = 'https://ossci-datasets.s3.amazonaws.com/mnist/'
# train images and labels
train_list = [
['train-images-idx3-ubyte.gz', 'f68b3c2dcbeaaa9fbdd348bbdeb94873'],
Expand Down
15 changes: 13 additions & 2 deletions sscma/datasets/pipelines/albu.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,21 @@ def __init__(self, transforms, p: float = 0.5):
super().__init__(transforms, p)


try:
_IAAAdditiveGaussianNoise = A.IAAAdditiveGaussianNoise
_IS_NEW_ALBUMENTATIONS = False
except AttributeError:
_IAAAdditiveGaussianNoise = A.GaussNoise
_IS_NEW_ALBUMENTATIONS = True


@TRANSFORMS.register_module()
class IAAAdditiveGaussianNoise(A.IAAAdditiveGaussianNoise):
class IAAAdditiveGaussianNoise(_IAAAdditiveGaussianNoise):
def __init__(self, loc=0, scale=..., per_channel=False, always_apply=False, p=0.5):
super().__init__(loc, scale, per_channel, always_apply, p)
if _IS_NEW_ALBUMENTATIONS:
super().__init__(mean=loc, per_channel=per_channel, always_apply=always_apply, p=p)
else:
super().__init__(loc, scale, per_channel, always_apply, p)


@TRANSFORMS.register_module()
Expand Down
24 changes: 2 additions & 22 deletions tools/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,34 +287,14 @@ def get_exported_file_name_from_precision(args, precision, ext: str = '') -> str


def export_pnnx(args, model):
import os.path as osp
import sys

import pnnx
from pnnx.wrapper import convert_inputshape_to_cmd

model.eval()
pnnx_bin_path = osp.join(osp.dirname(pnnx.__file__), 'bin')
bin_list = os.listdir(pnnx_bin_path)
x = torch.randn(args.input_shape)

cmd = ''
dir_dict = {}
for dir_name in bin_list:
if 'ubuntu' in dir_name:
dir_dict['linux'] = dir_name
elif 'windows' in dir_name:
dir_dict['win'] = dir_name
elif 'macos' in dir_name:
dir_dict['darwin'] = dir_name
if sys.platform.startswith('linux'):
cmd += os.path.join(pnnx_bin_path, dir_dict['linux'], 'pnnx ')
elif sys.platform.startswith('win'):
cmd += os.path.join(pnnx_bin_path, dir_dict['win'], 'pnnx.exe ')
elif sys.platform.startswith('darwin'):
cmd += os.path.join(pnnx_bin_path, dir_dict['darwin'], 'pnnx ')
cmd = pnnx.EXEC_PATH + ' '
cmd += 'model.pt '
cmd += convert_inputshape_to_cmd(x)
cmd += 'inputshape=' + ','.join(str(d) for d in x.shape) + ' '
cmd += ' pnnxparam=' + get_exported_file_name_from_precision(args, 'float', '.pnnx.param')
cmd += ' pnnxbin=' + get_exported_file_name_from_precision(args, 'float', '.pnnx.bin')
cmd += ' pnnxpy=' + get_exported_file_name_from_precision(args, 'float', '.pnnx.py')
Expand Down
Loading