Skip to content

Conversation

@momenator
Copy link
Owner

Fixed three major issues preventing the code from working:

  1. Fixed incorrect static method calls in both 2D and 3D versions

    • Removed duplicate 'self' parameter in _get_grid() calls
    • Changed _get_grid() from @staticmethod to instance method since it accesses instance variables (_grid_param, _grid)
  2. Fixed trilinear interpolation in 3D implementation

    • Removed incorrect use of coords_offset_rbp (negative offsets)
    • Now uses only coords_offset_lta (fractional offsets from lower corner)
    • Follows standard trilinear interpolation formula
  3. Added test file for validation

These fixes resolve TypeError that would occur when trying to use the deformable convolution layers.

Fixed three major issues preventing the code from working:

1. Fixed incorrect static method calls in both 2D and 3D versions
   - Removed duplicate 'self' parameter in _get_grid() calls
   - Changed _get_grid() from @staticmethod to instance method since it
     accesses instance variables (_grid_param, _grid)

2. Fixed trilinear interpolation in 3D implementation
   - Removed incorrect use of coords_offset_rbp (negative offsets)
   - Now uses only coords_offset_lta (fractional offsets from lower corner)
   - Follows standard trilinear interpolation formula

3. Added test file for validation

These fixes resolve TypeError that would occur when trying to use the
deformable convolution layers.
Major improvements to project structure and development workflow:

Package Setup:
- Added pyproject.toml with modern PEP 621 metadata
- Created deform_conv package with proper __init__.py
- Added py.typed marker for type checking support
- Created MANIFEST.in for package distribution

Development Tools:
- Added comprehensive .gitignore for Python projects
- Created Makefile with common development tasks
- Configured black, ruff, mypy, and pytest in pyproject.toml
- Added GitHub Actions CI/CD workflow for automated testing

Testing:
- Created tests/ directory with pytest test suite
- Added test cases for both 2D and 3D deformable convolutions
- Configured coverage reporting

Documentation:
- Expanded README with installation instructions
- Added usage examples for both 2D and 3D versions
- Documented development workflow and commands
- Added badges placeholders for CI status

Dependencies:
- Specified Python >=3.8 requirement
- Listed core dependencies (torch, numpy)
- Separated development dependencies

This modernizes the project to follow current Python packaging best
practices and provides a better developer experience.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants