Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aau-cns/poet
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: weniseb/poet
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing with 20,232 additions and 122 deletions.
  1. +10 −0 .gitignore
  2. +28 −0 CorrectedSummaryWriter.py
  3. +35 −0 changes.md
  4. +4 −0 constants.py
  5. +218 −0 cuda_torch_info.txt
  6. +180 −0 data_utils/data_annotation/hope2poet.py
  7. +152 −0 data_utils/data_annotation/icmi2poet.py
  8. +8 −7 data_utils/data_annotation/lmo2poet.py
  9. +8 −7 data_utils/data_annotation/ycbv2poet.py
  10. +12 −10 data_utils/pose_dataset.py
  11. +4 −0 data_utils/torchvision_datasets/coco.py
  12. +8 −0 dataset_files/custom_classes.json
  13. +8 −0 dataset_files/custom_symmetries.json
  14. +8 −0 dataset_files/icmi_classes.json
  15. +8 −0 dataset_files/icmi_symmetries.json
  16. +216 −0 demo/InferenceEngine.py
  17. +395 −0 demo/demo.py
  18. +269 −0 demo/helper.py
  19. +6 −0 docker.sh
  20. +73 −7 engine.py
  21. +205 −0 environment.yml
  22. +45 −0 eval.sh
  23. +6 −6 evaluation_tools/model_tools.py
  24. +22 −5 evaluation_tools/pose_evaluator.py
  25. +11 −4 evaluation_tools/pose_evaluator_init.py
  26. +22 −0 inference.sh
  27. +83 −3 inference_tools/inference_engine.py
  28. +14 −0 install.md
  29. +265 −56 main.py
  30. +27 −0 models/README_YOLO.md
  31. +10 −0 models/backbone.py
  32. +303 −0 models/backbone_rcnn_dino.py
  33. +557 −0 models/backbone_yolo_dino.py
  34. +147 −0 models/cns_yolo.py
  35. BIN models/groundingdino/_C.cpython-311-x86_64-linux-gnu.so
  36. BIN models/groundingdino/_C.cpython-38-x86_64-linux-gnu.so
  37. 0 models/groundingdino/__init__.py
  38. +43 −0 models/groundingdino/config/GroundingDINO_SwinB_cfg.py
  39. +43 −0 models/groundingdino/config/GroundingDINO_SwinT_OGC.py
  40. 0 models/groundingdino/config/__init__.py
  41. 0 models/groundingdino/datasets/__init__.py
  42. +269 −0 models/groundingdino/datasets/cocogrounding_eval.py
  43. +311 −0 models/groundingdino/datasets/transforms.py
  44. +15 −0 models/groundingdino/models/GroundingDINO/__init__.py
  45. +1 −0 models/groundingdino/models/GroundingDINO/backbone/__init__.py
  46. +221 −0 models/groundingdino/models/GroundingDINO/backbone/backbone.py
  47. +186 −0 models/groundingdino/models/GroundingDINO/backbone/position_encoding.py
  48. +802 −0 models/groundingdino/models/GroundingDINO/backbone/swin_transformer.py
  49. +273 −0 models/groundingdino/models/GroundingDINO/bertwarper.py
  50. +64 −0 models/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn.h
  51. +43 −0 models/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cpu.cpp
  52. +35 −0 models/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cpu.h
  53. +156 −0 models/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu
  54. +33 −0 models/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.h
  55. +1,327 −0 models/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_im2col_cuda.cuh
  56. +7 −0 models/groundingdino/models/GroundingDINO/csrc/cuda_version.cu
  57. +58 −0 models/groundingdino/models/GroundingDINO/csrc/vision.cpp
  58. +297 −0 models/groundingdino/models/GroundingDINO/fuse_modules.py
  59. +419 −0 models/groundingdino/models/GroundingDINO/groundingdino.py
  60. +413 −0 models/groundingdino/models/GroundingDINO/ms_deform_attn.py
  61. +959 −0 models/groundingdino/models/GroundingDINO/transformer.py
  62. +123 −0 models/groundingdino/models/GroundingDINO/transformer_vanilla.py
  63. +268 −0 models/groundingdino/models/GroundingDINO/utils.py
  64. +18 −0 models/groundingdino/models/__init__.py
  65. +66 −0 models/groundingdino/models/registry.py
  66. +1 −0 models/groundingdino/util/__init__.py
  67. +140 −0 models/groundingdino/util/box_ops.py
  68. +29 −0 models/groundingdino/util/get_tokenlizer.py
  69. +271 −0 models/groundingdino/util/inference.py
  70. +93 −0 models/groundingdino/util/logger.py
  71. +717 −0 models/groundingdino/util/misc.py
  72. +427 −0 models/groundingdino/util/slconfig.py
  73. +177 −0 models/groundingdino/util/slio.py
  74. +62 −0 models/groundingdino/util/time_counter.py
  75. +610 −0 models/groundingdino/util/utils.py
  76. +318 −0 models/groundingdino/util/visualizer.py
  77. +100 −0 models/groundingdino/util/vl_utils.py
  78. +1 −0 models/groundingdino/version.py
  79. +6 −2 models/matcher.py
  80. +49 −13 models/pose_estimation_transformer.py
  81. 0 models/yolo/__init__.py
  82. +1 −0 models/yolo/backbone_models/__init__.py
  83. +188 −0 models/yolo/backbone_models/common.py
  84. +145 −0 models/yolo/backbone_models/experimental.py
  85. +68 −0 models/yolo/backbone_models/export.py
  86. +506 −0 models/yolo/backbone_models/models.py
  87. +259 −0 models/yolo/backbone_models/yolo.py
  88. +80 −0 models/yolo/data/coco.names
  89. +18 −0 models/yolo/data/coco.yaml
  90. +27 −0 models/yolo/data/hyp.scratch.yaml
  91. +21 −0 models/yolo/data/pose_yolo.names
  92. +21 −0 models/yolo/data/ycbv.names
  93. +12 −0 models/yolo/data/ycbv.yaml
  94. +193 −0 models/yolo/detect.py
  95. +309 −0 models/yolo/test.py
  96. +512 −0 models/yolo/train.py
  97. +1 −0 models/yolo/yolo_utils/__init__.py
  98. +69 −0 models/yolo/yolo_utils/activations.py
  99. +907 −0 models/yolo/yolo_utils/datasets.py
  100. +1,237 −0 models/yolo/yolo_utils/general.py
  101. +76 −0 models/yolo/yolo_utils/google_utils.py
  102. +324 −0 models/yolo/yolo_utils/layers.py
  103. +70 −0 models/yolo/yolo_utils/parse_config.py
  104. +226 −0 models/yolo/yolo_utils/torch_utils.py
  105. +41 −0 poet2bop.py
  106. +388 −0 project/dataset/bop_annotations.py
  107. +54 −0 project/dataset/cleanup.py
  108. +115 −0 project/dataset/coco_annotations.py
  109. +102 −0 project/dataset/common.py
  110. +59 −0 project/dataset/correct_coordinates.py
  111. +151 −0 project/dataset/dataset_split.py
  112. +26 −0 project/dataset/delete_jpg_images.py
  113. +35 −0 project/dataset/extract_images.py
  114. +282 −0 project/eval_poet_inference.py
  115. +112 −0 project/record.py
  116. +38 −0 project/tensorboard_file.py
  117. +202 −0 requirements.txt
  118. +47 −0 results/train/2024-10-06_12:31:12/args.txt
  119. BIN results/train/2024-10-06_12:31:12/events.out.tfevents.1728210672.asterix.12420.0
  120. BIN results/train/2024-10-06_12:31:12/events.out.tfevents.1728239134.asterix.12420.1
  121. +51 −0 results/train/2024-10-06_12:31:12/log.txt
  122. +163 −0 rviz.rviz
  123. +32 −0 train.sh
  124. +6 −2 util/box_ops.py
  125. +31 −0 util/logger.py
  126. +209 −0 vis.py
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -5,3 +5,13 @@
*.pt
*.pth
*.tar

output*/
input*/
eval*/

*.jpg
*.png
.vscode

project/dataset/*
28 changes: 28 additions & 0 deletions CorrectedSummaryWriter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import torch
from torch.utils.tensorboard import SummaryWriter
from torch.utils.tensorboard.summary import hparams


class CorrectedSummaryWriter(SummaryWriter):
def __init__(
self,
log_dir=None,
comment="",
**kwargs
):
super().__init__(log_dir=log_dir, comment=comment, **kwargs)


def add_hparams(self, hparam_dict, metric_dict, hparam_domain_discrete=None, run_name=None, global_step=None):
torch._C._log_api_usage_once("tensorboard.logging.add_hparams")
if type(hparam_dict) is not dict or type(metric_dict) is not dict:
raise TypeError('hparam_dict and metric_dict should be dictionary.')
exp, ssi, sei = hparams(hparam_dict, metric_dict)

logdir = self._get_file_writer().get_logdir()
with SummaryWriter(log_dir=logdir) as w_hp:
w_hp.file_writer.add_summary(exp)
w_hp.file_writer.add_summary(ssi)
w_hp.file_writer.add_summary(sei)
for k, v in metric_dict.items():
w_hp.add_scalar(k, v)
35 changes: 35 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# PoET
## ycbv2poet
- changed `annotation_path = 'train_pbr_only.json'` to `'train_pbr.json'` because PoET will look for `annotations/train_pbr.json`

## main.py
- needed to add `args.dataset` to `bop_evaluate` at line #330 due to exception

## pose_dataset.py
Refactored `PATHS` to ...

```
PATHS = {
"train": (root, root / "annotations" / f'train.json'),
"train_synt": (root, root / "annotations" / f'train_synt.json'),
"train_pbr": (root, root / "annotations" / f'train_pbr.json'),
"test": (root, root / "annotations" / f'test.json'),
"test_all": (root, root / "annotations" / f'test.json'),
"keyframes": (root, root / "annotations" / f'keyframes.json'),
"keyframes_bop": (root, root / "annotations"/ f'keyframes_bop.json'),
"val": (root / "val", root / "annotations" / f'val.json'),
}
```
... because `pose_dataset.py` will prepend e.g. `train/`, `test/`, etc., to the image file paths in e.g., `annotations/train.json`


## coco.py
- added `annFile = json.load(open(annFile, 'r'))` in constructor of `CocoDetection` because `annFile` is of type `PosixPath` and COCO requires eather `str` or `dict`

## model_tools.py
- changed used numpy dtype `float` to `np.float` due to exception

# Bop_Toolkit
## visualization.py
- changed `text_width, text_height = font.getsize(txt)` in line #70 to `text_width, text_height = font.getbbox(txt)[2:4]` because the former is deprecated
- changed `model_type` to `fine` because `eval` 3D models dont have a normal that is required for visualization???
4 changes: 4 additions & 0 deletions constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import os

# VAR THAT POINTS TO ROOT DIRECTORY OF PoET
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
218 changes: 218 additions & 0 deletions cuda_torch_info.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
PyTorch built with:
- GCC 9.3
- C++ Version: 201703
- Intel(R) oneAPI Math Kernel Library Version 2023.1-Product Build 20230303 for Intel(R) 64 architecture applications
- Intel(R) MKL-DNN v3.3.6 (Git Hash 86e6af5974177e513fd3fee58425e1063e7f1361)
- OpenMP 201511 (a.k.a. OpenMP 4.5)
- LAPACK is enabled (usually provided by MKL)
- NNPACK is enabled
- CPU capability usage: AVX512
- CUDA Runtime 11.8
- NVCC architecture flags: -gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_90,code=sm_90
- CuDNN 8.7
- Magma 2.6.1
- Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.8, CUDNN_VERSION=8.7.0, CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++, CXX_FLAGS= -D_GLIBCXX_USE_CXX11_ABI=0 -fabi-version=11 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=bool-operation -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-stringop-overflow -Wsuggest-override -Wno-psabi -Wno-error=pedantic -Wno-error=old-style-cast -Wno-missing-braces -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=2.3.1, USE_CUDA=ON, USE_CUDNN=ON, USE_CUSPARSELT=1, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_GLOO=ON, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=1, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, USE_ROCM_KERNEL_ASSERT=OFF,

####################################
>>> torch.backends.cudnn.version()
8700

####################################
>>> cat /home/sebastian/miniconda3/envs/pytorch/lib/python3.8/site-packages/nvidia/cudnn/include/cudnn_version.h | grep CUDNN_MAJOR -A 2
#ifndef CUDNN_VERSION_H_
#define CUDNN_VERSION_H_

#define CUDNN_MAJOR 8
#define CUDNN_MINOR 7
#define CUDNN_PATCHLEVEL 0

#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)

/* cannot use constexpr here since this is a C-only file */
/* Below is the max SM version this cuDNN library is aware of and supports natively */

#define CUDNN_MAX_SM_MAJOR_NUMBER 9
#define CUDNN_MAX_SM_MINOR_NUMBER 0
#define CUDNN_MAX_DEVICE_VERSION (CUDNN_MAX_SM_MAJOR_NUMBER * 100) + (CUDNN_MAX_SM_MINOR_NUMBER * 10)

#endif /* CUDNN_VERSION_H */

####################################
>>> cat /proc/driver/nvidia/version  ✔  base   10:10:46
NVRM version: NVIDIA UNIX x86_64 Kernel Module 550.120 Fri Sep 13 10:10:01 UTC 2024
GCC version: gcc version 12.3.0 (Ubuntu 12.3.0-1ubuntu1~22.04)

####################################
>>> gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

#####################################
>>> nvidia-smi
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.120 Driver Version: 550.120 CUDA Version: 12.4 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 4060 Ti Off | 00000000:01:00.0 On | N/A |
| 0% 44C P3 25W / 165W | 3099MiB / 16380MiB | 15% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 1996 G /usr/lib/xorg/Xorg 2204MiB |
| 0 N/A N/A 2154 G /usr/bin/gnome-shell 157MiB |
| 0 N/A N/A 4797 G ...seed-version=20241120-181307.991000 265MiB |
| 0 N/A N/A 26715 G ...nglingPtr --variations-seed-version 266MiB |
| 0 N/A N/A 33006 G ...erProcess --variations-seed-version 106MiB |
+-----------------------------------------------------------------------------------------+

#########################################
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False

##########################################
>>> nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:33:58_PDT_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0

##########################################
>>> cat /usr/local/cuda/version.json

{
"cuda" : {
"name" : "CUDA SDK",
"version" : "11.8.20220929"
},
"cuda_cccl" : {
"name" : "CUDA C++ Core Compute Libraries",
"version" : "11.8.89"
},
"cuda_cudart" : {
"name" : "CUDA Runtime (cudart)",
"version" : "11.8.89"
},
"cuda_cuobjdump" : {
"name" : "cuobjdump",
"version" : "11.8.86"
},
"cuda_cupti" : {
"name" : "CUPTI",
"version" : "11.8.87"
},
"cuda_cuxxfilt" : {
"name" : "CUDA cu++ filt",
"version" : "11.8.86"
},
"cuda_demo_suite" : {
"name" : "CUDA Demo Suite",
"version" : "11.8.86"
},
"cuda_gdb" : {
"name" : "CUDA GDB",
"version" : "11.8.86"
},
"cuda_memcheck" : {
"name" : "CUDA Memcheck",
"version" : "11.8.86"
},
"cuda_nsight" : {
"name" : "Nsight Eclipse Plugins",
"version" : "11.8.86"
},
"cuda_nvcc" : {
"name" : "CUDA NVCC",
"version" : "11.8.89"
},
"cuda_nvdisasm" : {
"name" : "CUDA nvdisasm",
"version" : "11.8.86"
},
"cuda_nvml_dev" : {
"name" : "CUDA NVML Headers",
"version" : "11.8.86"
},
"cuda_nvprof" : {
"name" : "CUDA nvprof",
"version" : "11.8.87"
},
"cuda_nvprune" : {
"name" : "CUDA nvprune",
"version" : "11.8.86"
},
"cuda_nvrtc" : {
"name" : "CUDA NVRTC",
"version" : "11.8.89"
},
"cuda_nvtx" : {
"name" : "CUDA NVTX",
"version" : "11.8.86"
},
"cuda_nvvp" : {
"name" : "CUDA NVVP",
"version" : "11.8.87"
},
"cuda_sanitizer_api" : {
"name" : "CUDA Compute Sanitizer API",
"version" : "11.8.86"
},
"libcublas" : {
"name" : "CUDA cuBLAS",
"version" : "11.11.3.6"
},
"libcufft" : {
"name" : "CUDA cuFFT",
"version" : "10.9.0.58"
},
"libcufile" : {
"name" : "GPUDirect Storage (cufile)",
"version" : "1.4.0.31"
},
"libcurand" : {
"name" : "CUDA cuRAND",
"version" : "10.3.0.86"
},
"libcusolver" : {
"name" : "CUDA cuSOLVER",
"version" : "11.4.1.48"
},
"libcusparse" : {
"name" : "CUDA cuSPARSE",
"version" : "11.7.5.86"
},
"libnpp" : {
"name" : "CUDA NPP",
"version" : "11.8.0.86"
},
"libnvjpeg" : {
"name" : "CUDA nvJPEG",
"version" : "11.9.0.86"
},
"nsight_compute" : {
"name" : "Nsight Compute",
"version" : "2022.3.0.22"
},
"nsight_systems" : {
"name" : "Nsight Systems",
"version" : "2022.4.2.1"
},
"nvidia_driver" : {
"name" : "NVIDIA Linux Driver",
"version" : "520.61.05"
},
"nvidia_fs" : {
"name" : "NVIDIA file-system",
"version" : "2.13.5"
}
}
Loading