Skip to content

Commit

Permalink
Merge pull request #706 from torch-points3d/precommit-fix
Browse files Browse the repository at this point in the history
Fix formatting over entire repo
  • Loading branch information
nicolas-chaulet committed Jan 13, 2022
2 parents 8e4c19e + 2320ad1 commit 68795cc
Show file tree
Hide file tree
Showing 106 changed files with 2,321 additions and 6,132 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM principialabs/torch-points3d:latest-cpu

COPY .devcontainer/setup.sh setup.sh
RUN bash setup.sh
ENV PATH="${PATH}:$HOME/.poetry/bin"
ENV PATH="${PATH}:$HOME/.poetry/bin"
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile.gpu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM principialabs/torch-points3d:latest-gpu

COPY .devcontainer/setup.sh setup.sh
RUN bash setup.sh
RUN bash setup.sh
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
"extensions": [
"ms-python.python"
]
}
}
2 changes: 1 addition & 1 deletion .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Static checks with flake8 and mypy
run: |
source ${pythonEnv}/bin/activate
pip install flake8 mypy # Dev tools
pip install flake8 mypy==0.910 # Dev tools
make staticchecks
env:
pythonEnv: /home/runner/.cache/${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def main(cfg):
OmegaConf.set_struct(cfg, False) # This allows getattr and hasattr methods to function correctly
if cfg.pretty_print:
print(OmegaConf.to_yaml(cfg))

trainer = Trainer(cfg)
trainer.eval()
#
Expand Down
7 changes: 6 additions & 1 deletion examples/pointnet2_classification_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
# Batch(batch=[2], pos=[2, 1024, 3], x=[2, 1024, 5])


model = PointNet2(architecture="encoder", input_nc=input_nc, num_layers=3, output_nc=num_classes,)
model = PointNet2(
architecture="encoder",
input_nc=input_nc,
num_layers=3,
output_nc=num_classes,
)

res = model(data)
print(res)
Expand Down
11 changes: 6 additions & 5 deletions examples/pointnet_segmentation_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import torch

from utils import load_local_torchpoints3d

load_local_torchpoints3d()

from torch_points3d.models.segmentation.pointnet import PointNet
Expand All @@ -21,9 +22,9 @@
data = Batch.from_data_list([data, data])

print(data)
#Batch(batch=[1000], pos=[1000, 3], x=[1000, 3])
# Batch(batch=[1000], pos=[1000, 3], x=[1000, 3])

pointnet = PointNet(OmegaConf.create({'conv_type': 'PARTIAL_DENSE'}))
pointnet = PointNet(OmegaConf.create({"conv_type": "PARTIAL_DENSE"}))

pointnet.set_input(data, "cpu")
data_out = pointnet.forward()
Expand All @@ -43,11 +44,11 @@
data = SimpleBatch.from_data_list([data, data])

print(data)
#SimpleBatch(pos=[2, 500, 3], x=[2, 500, 3])
# SimpleBatch(pos=[2, 500, 3], x=[2, 500, 3])

pointnet = PointNet(OmegaConf.create({'conv_type': 'DENSE'}))
pointnet = PointNet(OmegaConf.create({"conv_type": "DENSE"}))

pointnet.set_input(data, "cpu")
data_out = pointnet.forward()
print(data_out.shape)
#torch.Size([2, 500, 4])
# torch.Size([2, 500, 4])
2 changes: 1 addition & 1 deletion examples/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def load_local_torchpoints3d():
spec = importlib.util.spec_from_file_location(MODULE_NAME, MODULE_PATH)
module = importlib.util.module_from_spec(spec)
sys.modules[spec.name] = module
spec.loader.exec_module(module)
spec.loader.exec_module(module)
6 changes: 5 additions & 1 deletion forward_scripts/forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ def main(cfg):
# Set dataloaders
dataset = instantiate_dataset(checkpoint.data_config)
dataset.create_dataloaders(
model, cfg.batch_size, cfg.shuffle, cfg.num_workers, False,
model,
cfg.batch_size,
cfg.shuffle,
cfg.num_workers,
False,
)
log.info(dataset)

Expand Down

0 comments on commit 68795cc

Please sign in to comment.