From 9feae8befac80d4d918ec0194b3a2e73c3e44fb8 Mon Sep 17 00:00:00 2001 From: PMCLSF Date: Sun, 15 Feb 2026 23:26:22 -0100 Subject: [PATCH 1/4] docs: update README and requirements.txt to match codebase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Python 3.8+ → 3.10+, TensorFlow ≥2.11 → ~=2.15 - Add tensorflow-probability to prerequisites table - Update requirements.txt versions to match installed packages - Remove pyntcloud (unused), add keras-tuner - Fix project structure: remove nonexistent decompress_octree.py and config/ directory, add 14 missing source files and full test listing Co-Authored-By: Claude Opus 4.6 --- README.md | 106 +++++++++++++++++++++++++++++------------------ requirements.txt | 20 ++++----- 2 files changed, 75 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index cfadedcc8..8cdbbb28c 100644 --- a/README.md +++ b/README.md @@ -552,8 +552,9 @@ print(f"Peak memory: {mem.peak_mb:.1f} MB") | Software | Version | Purpose | |----------|---------|---------| -| Python | 3.8+ | Programming language | -| TensorFlow | ≥ 2.11.0 | Neural network framework | +| Python | 3.10+ | Programming language | +| TensorFlow | ~=2.15 | Neural network framework | +| TensorFlow Probability | ~=0.23 | Probability distributions for entropy modeling | | MPEG G-PCC | Latest | Industry-standard codec for comparison | | MPEG PCC Metrics | v0.12.3 | Standard evaluation metrics | @@ -561,16 +562,17 @@ print(f"Peak memory: {mem.peak_mb:.1f} MB") Install these with `pip install -r requirements.txt`: -| Package | Purpose | -|---------|---------| -| tensorflow | Neural network operations | -| tensorflow-probability | Probability distributions for entropy modeling | -| numpy | Numerical computations | -| matplotlib | Visualization | -| pandas | Data analysis | -| pyyaml | Configuration file parsing | -| scipy | Scientific computing | -| numba | JIT compilation for speed | +| Package | Version | Purpose | +|---------|---------|---------| +| tensorflow | ~=2.15 | Neural network operations | +| tensorflow-probability | ~=0.23 | Probability distributions for entropy modeling | +| numpy | ~=1.26 | Numerical computations | +| matplotlib | ~=3.8 | Visualization | +| pandas | ~=2.1 | Data analysis | +| pyyaml | ~=6.0 | Configuration file parsing | +| scipy | ~=1.11 | Scientific computing | +| numba | ~=0.58 | JIT compilation for speed | +| keras-tuner | ~=1.4 | Hyperparameter tuning (for cli_train.py) | --- @@ -578,43 +580,65 @@ Install these with `pip install -r requirements.txt`: ``` deepcompress/ -├── src/ # Source code +├── src/ # Source code │ ├── Model Components -│ │ ├── model_transforms.py # Main encoder/decoder architecture -│ │ ├── entropy_model.py # Entropy coding (converts to bits) -│ │ ├── entropy_parameters.py # Hyperprior parameter prediction -│ │ ├── context_model.py # Spatial autoregressive context -│ │ ├── channel_context.py # Channel-wise context -│ │ └── attention_context.py # Attention-based context +│ │ ├── model_transforms.py # Main encoder/decoder (V1 + V2) architecture +│ │ ├── entropy_model.py # Gaussian conditional, hyperprior entropy models +│ │ ├── entropy_parameters.py # Hyperprior mean/scale prediction network +│ │ ├── context_model.py # MaskedConv3D, autoregressive spatial context +│ │ ├── channel_context.py # Channel-wise context model +│ │ └── attention_context.py # Windowed attention context model │ │ │ ├── Performance -│ │ ├── constants.py # Pre-computed math constants -│ │ ├── precision_config.py # Mixed precision settings -│ │ ├── benchmarks.py # Performance measurement -│ │ └── quick_benchmark.py # Quick testing tool +│ │ ├── constants.py # Pre-computed math constants (LOG_2, EPSILON) +│ │ ├── precision_config.py # Mixed precision (float16) settings +│ │ ├── benchmarks.py # Performance measurement +│ │ └── quick_benchmark.py # Quick synthetic smoke test │ │ │ ├── Data Processing -│ │ ├── ds_mesh_to_pc.py # Convert meshes to point clouds -│ │ ├── ds_pc_octree_blocks.py# Split into octree blocks -│ │ ├── compress_octree.py # Compression pipeline -│ │ └── decompress_octree.py # Decompression pipeline +│ │ ├── data_loader.py # Unified data loader (ModelNet40 / 8iVFB) +│ │ ├── ds_mesh_to_pc.py # Convert .off meshes to point clouds +│ │ ├── ds_pc_octree_blocks.py # Split point clouds into octree blocks +│ │ ├── ds_select_largest.py # Select N largest blocks by point count +│ │ ├── octree_coding.py # Octree encode/decode for voxel grids +│ │ ├── compress_octree.py # Compression entry point +│ │ └── map_color.py # Transfer colors between point clouds │ │ -│ └── Training & Evaluation -│ ├── training_pipeline.py # End-to-end training -│ ├── evaluation_pipeline.py# Model evaluation -│ └── cli_train.py # Command-line interface +│ ├── Training & Evaluation +│ │ ├── training_pipeline.py # End-to-end training loop +│ │ ├── evaluation_pipeline.py # Model evaluation pipeline +│ │ ├── cli_train.py # Training CLI with hyperparameter tuning +│ │ └── experiment.py # Experiment runner +│ │ +│ └── Evaluation & Comparison +│ ├── ev_compare.py # Point cloud quality metrics (PSNR, Chamfer) +│ ├── ev_run_render.py # Visualization / rendering +│ ├── point_cloud_metrics.py # D1/D2 point-to-point metrics +│ ├── mp_report.py # MPEG G-PCC comparison reports +│ ├── colorbar.py # Colorbar visualization utility +│ └── parallel_process.py # Parallel processing utility │ -├── tests/ # Automated tests -│ ├── test_entropy_model.py -│ ├── test_context_model.py -│ ├── test_performance.py # Performance regression tests -│ └── ... +├── tests/ # Automated tests (pytest + tf.test.TestCase) +│ ├── conftest.py # Session-scoped fixtures (tf_config, file factories) +│ ├── test_utils.py # Shared test utilities (mock grids, configs) +│ ├── test_model_transforms.py # V1 + V2 model tests +│ ├── test_entropy_model.py # Entropy model tests +│ ├── test_context_model.py # Context model tests +│ ├── test_channel_context.py # Channel context tests +│ ├── test_attention_context.py # Attention context tests +│ ├── test_performance.py # Performance regression + optimization tests +│ ├── test_training_pipeline.py # Training loop tests +│ ├── test_evaluation_pipeline.py # Evaluation pipeline tests +│ ├── test_data_loader.py # Data loading tests +│ ├── test_compress_octree.py # Compression pipeline tests +│ ├── test_octree_coding.py # Octree codec tests +│ └── ... # + 10 more module-level test files │ -├── config/ # Configuration files -├── data/ # Datasets (not in git) -├── results/ # Output files (not in git) -├── README.md # This file -└── requirements.txt # Python dependencies +├── data/ # Datasets (not in git) +├── results/ # Output files (not in git) +├── pytest.ini # Pytest configuration and markers +├── README.md # This file +└── requirements.txt # Python dependencies ``` --- diff --git a/requirements.txt b/requirements.txt index 93bd3622f..d2c76caeb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,11 @@ -matplotlib~=3.5.0 -pyntcloud~=0.1.2 -numpy~=1.23.0 -pandas~=1.4.0 -tqdm~=4.64.0 -tensorflow~=2.11.0 +tensorflow~=2.15.0 +tensorflow-probability~=0.23.0 +numpy~=1.26.0 +matplotlib~=3.8.0 +pandas~=2.1.0 +tqdm~=4.66.0 pyyaml~=6.0 -pytest~=7.1.0 -scipy~=1.8.1 -numba~=0.56.0 -tensorflow-probability~=0.19.0 +pytest~=8.0.0 +scipy~=1.11.0 +numba~=0.58.0 +keras-tuner~=1.4.0 From 5ccbd1107e1e77dd38a8dc493b18b3d67ddf8599 Mon Sep 17 00:00:00 2001 From: PMCLSF Date: Sun, 15 Feb 2026 23:48:23 -0100 Subject: [PATCH 2/4] style: fix ruff lint errors (import sorting, unused import, line length) Auto-fixed 14 import sorting violations (I001) and 1 unused import (F401). Manually fixed 1 line-too-long (E501) in training_pipeline.py by extracting input reshaping to a local variable. Co-Authored-By: Claude Opus 4.6 --- src/evaluation_pipeline.py | 2 +- src/model_transforms.py | 2 +- src/training_pipeline.py | 6 ++++-- tests/conftest.py | 1 - tests/test_colorbar.py | 3 +-- tests/test_entropy_model.py | 1 - tests/test_evaluation_pipeline.py | 1 - tests/test_integration.py | 2 +- tests/test_performance.py | 11 ++++++----- 9 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/evaluation_pipeline.py b/src/evaluation_pipeline.py index 0a44e5fc8..a1787110b 100644 --- a/src/evaluation_pipeline.py +++ b/src/evaluation_pipeline.py @@ -1,7 +1,7 @@ import logging from dataclasses import asdict, dataclass from pathlib import Path -from typing import Any, Dict, List +from typing import Any, Dict import tensorflow as tf diff --git a/src/model_transforms.py b/src/model_transforms.py index aed2c2bb2..ab38c7ec3 100644 --- a/src/model_transforms.py +++ b/src/model_transforms.py @@ -3,7 +3,7 @@ import tensorflow as tf -from constants import LOG_2_RECIPROCAL, EPSILON +from constants import EPSILON, LOG_2_RECIPROCAL @dataclass diff --git a/src/training_pipeline.py b/src/training_pipeline.py index e3d3709f4..ffdb1070f 100644 --- a/src/training_pipeline.py +++ b/src/training_pipeline.py @@ -9,9 +9,10 @@ class TrainingPipeline: def __init__(self, config_path: str): import yaml + from data_loader import DataLoader - from model_transforms import DeepCompressModel, TransformConfig from entropy_model import EntropyModel + from model_transforms import DeepCompressModel, TransformConfig self.config_path = config_path with open(config_path, 'r') as f: @@ -50,7 +51,8 @@ def __init__(self, config_path: str): def _train_step(self, batch: tf.Tensor, training: bool = True) -> Dict[str, tf.Tensor]: """Run a single training step.""" with tf.GradientTape(persistent=True) as tape: - x_hat, y, y_hat, z = self.model(batch[..., tf.newaxis] if len(batch.shape) == 4 else batch, training=training) + inputs = batch[..., tf.newaxis] if len(batch.shape) == 4 else batch + x_hat, y, y_hat, z = self.model(inputs, training=training) # Compute focal loss on reconstruction focal_loss = self.compute_focal_loss( diff --git a/tests/conftest.py b/tests/conftest.py index a32418792..285a46f5d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5,7 +5,6 @@ import tensorflow as tf - def pytest_collection_modifyitems(items): """Filter out tf.test.TestCase.test_session, which is a deprecated context manager that pytest mistakenly collects as a test.""" diff --git a/tests/test_colorbar.py b/tests/test_colorbar.py index 048f50294..56cd833bc 100644 --- a/tests/test_colorbar.py +++ b/tests/test_colorbar.py @@ -3,13 +3,12 @@ sys.path.insert(0, str(Path(__file__).parent.parent / 'src')) -import json import matplotlib.pyplot as plt import numpy as np import pytest -from colorbar import ColorbarConfig, get_colorbar +from colorbar import get_colorbar class TestColorbar: diff --git a/tests/test_entropy_model.py b/tests/test_entropy_model.py index f53e54fe9..93dd879b4 100644 --- a/tests/test_entropy_model.py +++ b/tests/test_entropy_model.py @@ -8,7 +8,6 @@ from entropy_model import EntropyModel, PatchedGaussianConditional - class TestEntropyModel(tf.test.TestCase): def setUp(self): tf.random.set_seed(42) diff --git a/tests/test_evaluation_pipeline.py b/tests/test_evaluation_pipeline.py index a0f4bdae3..dc254a2f6 100644 --- a/tests/test_evaluation_pipeline.py +++ b/tests/test_evaluation_pipeline.py @@ -2,7 +2,6 @@ import sys from pathlib import Path -import numpy as np import pytest import tensorflow as tf import yaml diff --git a/tests/test_integration.py b/tests/test_integration.py index 718e3a672..8714810ab 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -10,7 +10,7 @@ from data_loader import DataLoader from evaluation_pipeline import EvaluationPipeline from model_transforms import DeepCompressModel, DeepCompressModelV2, TransformConfig -from test_utils import create_mock_point_cloud, create_mock_voxel_grid, create_test_dataset, setup_test_environment +from test_utils import create_mock_point_cloud, create_mock_voxel_grid, setup_test_environment from training_pipeline import TrainingPipeline diff --git a/tests/test_performance.py b/tests/test_performance.py index b7a114079..0e933eaea 100644 --- a/tests/test_performance.py +++ b/tests/test_performance.py @@ -95,25 +95,25 @@ def test_f16_constants_accuracy(self, tf_setup): def test_get_log2_constant_f32(self, tf_setup): """Verify get_log2_constant returns LOG_2 for default dtype.""" - from constants import get_log2_constant, LOG_2 + from constants import LOG_2, get_log2_constant result = get_log2_constant() assert result is LOG_2 def test_get_log2_constant_f16(self, tf_setup): """Verify get_log2_constant returns LOG_2_F16 for float16.""" - from constants import get_log2_constant, LOG_2_F16 + from constants import LOG_2_F16, get_log2_constant result = get_log2_constant(tf.float16) assert result is LOG_2_F16 def test_get_log2_reciprocal_f32(self, tf_setup): """Verify get_log2_reciprocal returns LOG_2_RECIPROCAL for default dtype.""" - from constants import get_log2_reciprocal, LOG_2_RECIPROCAL + from constants import LOG_2_RECIPROCAL, get_log2_reciprocal result = get_log2_reciprocal() assert result is LOG_2_RECIPROCAL def test_get_log2_reciprocal_f16(self, tf_setup): """Verify get_log2_reciprocal returns LOG_2_RECIPROCAL_F16 for float16.""" - from constants import get_log2_reciprocal, LOG_2_RECIPROCAL_F16 + from constants import LOG_2_RECIPROCAL_F16, get_log2_reciprocal result = get_log2_reciprocal(tf.float16) assert result is LOG_2_RECIPROCAL_F16 @@ -363,9 +363,10 @@ def test_configure_invalid_policy(self, tf_setup): def test_configure_mixed_float16_warns_on_cpu(self, tf_setup): """Verify UserWarning when enabling float16 on CPU.""" - from precision_config import PrecisionManager import warnings as w + from precision_config import PrecisionManager + gpus = tf.config.list_physical_devices('GPU') if gpus: pytest.skip("Test requires CPU-only environment") From bd294155056a28aad8caf592ff141e73626f7220 Mon Sep 17 00:00:00 2001 From: PMCLSF Date: Sun, 15 Feb 2026 23:51:29 -0100 Subject: [PATCH 3/4] ci: update test matrix to Python 3.10+ (TF 2.15 requirement) TF 2.15 does not support Python 3.8/3.9. Update CI matrix from [3.8, 3.9, 3.10] to [3.10, 3.11, 3.12] to match the project's Python 3.10+ requirement. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5a94fdb3..d99e12f6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: needs: lint strategy: matrix: - python-version: ['3.8', '3.9', '3.10'] + python-version: ['3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 From 2008b21ec1b604e858ddd6f16fecb4509c8f731a Mon Sep 17 00:00:00 2001 From: PMCLSF Date: Sun, 15 Feb 2026 23:53:16 -0100 Subject: [PATCH 4/4] ci: remove Python 3.12 from matrix (TF 2.15 supports 3.9-3.11 only) Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d99e12f6f..17cf517db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: needs: lint strategy: matrix: - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11'] steps: - uses: actions/checkout@v4