4 |
5 |
6 |
10 | SwaggerUI
11 |
12 |
13 |
14 |
15 |
16 |
17 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/config/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NVIDIA/tao_deploy/21c66f2b294e837e39eaa574d1f1d72e977ffb21/nvidia_tao_deploy/config/__init__.py
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """CV root module."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/centerpose/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy CenterPose."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/centerpose/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for CenterPose."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/centerpose/hydra_config/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Init Module."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/centerpose/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy CenterPose scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/centerpose/specs/evaluate.yaml:
--------------------------------------------------------------------------------
1 | encryption_key: "???"
2 | results_dir: "???"
3 |
4 | evaluate:
5 | num_gpus: 1
6 | trt_engine: "???"
7 | opencv: False
8 | eval_num_symmetry: 1
9 | results_dir: "???"
10 |
11 | dataset:
12 | test_data: "???"
13 | num_classes: 1
14 | batch_size: 2
15 | workers: 4
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/centerpose/specs/gen_trt_engine.yaml:
--------------------------------------------------------------------------------
1 | encryption_key: "???"
2 | results_dir: "???"
3 |
4 | gen_trt_engine:
5 | gpu_id: 0
6 | onnx_file: "???"
7 | trt_engine: "???"
8 | input_channel: 3
9 | input_width: 512
10 | input_height: 512
11 | tensorrt:
12 | data_type: fp32
13 | workspace_size: 1024
14 | min_batch_size: 1
15 | opt_batch_size: 2
16 | max_batch_size: 4
17 | calibration:
18 | cal_image_dir: "???"
19 | cal_cache_file: "???"
20 | cal_batch_size: 10
21 | cal_batches: 1000
22 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/centerpose/specs/infer.yaml:
--------------------------------------------------------------------------------
1 | encryption_key: "???"
2 | results_dir: "???"
3 |
4 | dataset:
5 | inference_data: "???"
6 | num_classes: 1
7 | batch_size: 1
8 | workers: 4
9 |
10 | inference:
11 | trt_engine: "???"
12 | visualization_threshold: 0.3
13 | principle_point_x: 298.3225504557292
14 | principle_point_y: 392.1635182698568
15 | focal_length_x: 651.2994384765625
16 | focal_length_y: 651.2994384765625
17 | skew: 0.0
18 | axis_size: 0.5
19 | use_pnp: True
20 | save_json: True
21 | save_visualization: True
22 | opencv: True
23 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_pyt/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy PyTorch Classification."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_pyt/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for classification."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_pyt/hydra_config/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | """TAO Deploy Classification Hydra."""
17 |
18 | from __future__ import absolute_import
19 | from __future__ import division
20 | from __future__ import print_function
21 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_pyt/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Classification PyT scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_pyt/specs/evaluate.yaml:
--------------------------------------------------------------------------------
1 | results_dir: "???"
2 | evaluate:
3 | trt_engine: "???"
4 | batch_size: 8
5 | topk: 1
6 | dataset:
7 | data:
8 | test:
9 | data_prefix: "???"
10 | classes: "???"
11 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_pyt/specs/gen_trt_engine.yaml:
--------------------------------------------------------------------------------
1 | gen_trt_engine:
2 | onnx_file: "???"
3 | trt_engine: "???"
4 | tensorrt:
5 | data_type: FP32
6 | min_batch_size: 1
7 | opt_batch_size: 4
8 | max_batch_size: 8
9 | results_dir: "???"
10 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_pyt/specs/inference.yaml:
--------------------------------------------------------------------------------
1 | results_dir: "???"
2 | inference:
3 | trt_engine: "???"
4 | batch_size: 8
5 | dataset:
6 | data:
7 | test:
8 | data_prefix: "???"
9 | classes: "???"
10 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf1/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy TF1 Classification."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf1/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for classification."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf1/proto/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Classification Proto."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf1/proto/eval_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * experiment.proto: Protocol buffer definition for a top-level message
5 | * encapsulating multiple other message types to form a complete specification
6 | * for a MakeNet experiment.
7 | */
8 |
9 | syntax = "proto3";
10 |
11 | message EvalConfig {
12 | uint32 top_k = 1;
13 | string eval_dataset_path = 2;
14 | string model_path = 3;
15 | uint32 batch_size = 4;
16 | uint32 n_workers = 5;
17 | bool enable_center_crop = 6;
18 | }
19 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf1/proto/experiment.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * experiment.proto: Protocol buffer definition for a top-level message
5 | * encapsulating multiple other message types to form a complete specification
6 | * for a classification experiment.
7 | */
8 |
9 | syntax = "proto3";
10 |
11 | import "nvidia_tao_deploy/cv/classification_tf1/proto/model_config.proto";
12 | import "nvidia_tao_deploy/cv/classification_tf1/proto/eval_config.proto";
13 | import "nvidia_tao_deploy/cv/classification_tf1/proto/train_config.proto";
14 |
15 | message Experiment {
16 | EvalConfig eval_config = 1;
17 | ModelConfig model_config = 2;
18 | TrainConfig train_config = 3;
19 | }
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf1/proto/lr_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * experiment.proto: Protocol buffer definition for a top-level message
5 | * encapsulating multiple other message types to form a complete specification
6 | * for a MakeNet experiment.
7 | */
8 |
9 | syntax = "proto3";
10 |
11 | message StepLrConfig {
12 | float learning_rate = 1;
13 | uint32 step_size = 2;
14 | float gamma = 3;
15 | }
16 |
17 | message SoftAnnealLrConfig {
18 | float learning_rate = 1;
19 | float soft_start = 2;
20 | float annealing_divider = 3;
21 | repeated float annealing_points = 7;
22 | }
23 |
24 | message CosineLrConfig {
25 | float learning_rate = 1;
26 | float min_lr_ratio = 2;
27 | float soft_start = 3;
28 | }
29 |
30 | message LRConfig {
31 | oneof lr_scheduler {
32 | StepLrConfig step = 1;
33 | SoftAnnealLrConfig soft_anneal = 2;
34 | CosineLrConfig cosine = 3;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf1/proto/optimizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * experiment.proto: Protocol buffer definition for a top-level message
5 | * encapsulating multiple other message types to form a complete specification
6 | * for a MakeNet experiment.
7 | */
8 |
9 | syntax = "proto3";
10 |
11 | message SgdOptimizerConfig {
12 | float lr = 1;
13 | float decay = 2;
14 | float momentum = 3;
15 | bool nesterov = 4;
16 | }
17 |
18 | message AdamOptimizerConfig {
19 | float lr = 1;
20 | float beta_1 = 2;
21 | float beta_2 = 3;
22 | float epsilon = 4;
23 | float decay = 5;
24 | }
25 |
26 | message RmspropOptimizerConfig {
27 | float lr = 1;
28 | float rho = 2;
29 | float epsilon = 3;
30 | float decay = 4;
31 | }
32 |
33 | message OptimizerConfig {
34 | oneof optim {
35 | SgdOptimizerConfig sgd = 1;
36 | AdamOptimizerConfig adam = 2;
37 | RmspropOptimizerConfig rmsprop = 3;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf1/proto/regularizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * experiment.proto: Protocol buffer definition for a top-level message
5 | * encapsulating multiple other message types to form a complete specification
6 | * for a MakeNet experiment.
7 | */
8 |
9 | syntax = "proto3";
10 |
11 | message RegConfig {
12 | string type = 1;
13 | string scope = 2;
14 | float weight_decay = 3;
15 | }
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf1/proto/visualizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * visualizer_config.proto: Protocol buffer definition for training visualizations.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message VisualizerConfig {
10 | // Master switch.
11 | bool enabled = 1;
12 |
13 | // Number of images to add to Tensorboard visualization.
14 | uint32 num_images = 2;
15 |
16 | //visualize histograms
17 | bool weight_histograms = 3;
18 | }
19 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf1/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Classification TF1 scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf1/specs/experiment_spec.txt:
--------------------------------------------------------------------------------
1 | model_config {
2 | arch: "resnet",
3 | n_layers: 18
4 | # Setting these parameters to true to match the template downloaded from NGC.
5 | use_batch_norm: true
6 | all_projections: true
7 | freeze_blocks: 0
8 | freeze_blocks: 1
9 | input_image_size: "3,224,224"
10 | }
11 | train_config {
12 | preprocess_mode: "caffe"
13 | }
14 | eval_config {
15 | eval_dataset_path: "/home/projects1_metropolis/tmp/sean/22.04/classification_notebook/data/split/test"
16 | model_path: "/home/projects1_metropolis/tmp/sean/22.04/classification_notebook/output/weights/resnet_080.tlt"
17 | top_k: 3
18 | batch_size: 256
19 | n_workers: 8
20 | enable_center_crop: True
21 | }
22 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf2/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy TF2 Classification."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf2/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for classification."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf2/hydra_config/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | """TAO Deploy Classification Hydra."""
17 |
18 | from __future__ import absolute_import
19 | from __future__ import division
20 | from __future__ import print_function
21 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf2/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Classification TF2 scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/classification_tf2/specs/experiment_spec.yaml:
--------------------------------------------------------------------------------
1 | results_dir: ???
2 | train:
3 | qat: False
4 | dataset:
5 | preprocess_mode: 'torch'
6 | image_mean: [0.485, 0.456, 0.406]
7 | evaluate:
8 | dataset_path: ???
9 | trt_engine: ???
10 | top_k: 1
11 | batch_size: 16
12 | classmap: ???
13 | gen_trt_engine:
14 | onnx_file: ???
15 | trt_engine: ???
16 | tensorrt:
17 | max_workspace_size: 2
18 | data_type: 'fp16'
19 | min_batch_size: 1
20 | opt_batch_size: 16
21 | max_batch_size: 16
22 | cal_image_dir: ???
23 | cal_cache_file: ???
24 | cal_data_file: ???
25 | batch_size: 16
26 | batches: 3125
27 | max_batch_size: 64
28 | inference:
29 | model_path: ???
30 | image_dir: ???
31 | classmap: ???
32 | data_format: 'channels_last'
33 | verbose: True
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Common Modules."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/config/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Common Hydra Modules."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/config/prune_config.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Default config file."""
16 |
17 | from typing import Optional
18 | from dataclasses import dataclass
19 |
20 |
21 | @dataclass
22 | class PruneConfig:
23 | """Prune config."""
24 |
25 | mode: str = "amount" # [amount, threshold, experimental_hybrid]
26 | amount: Optional[float] = None
27 | threshold: Optional[float] = None
28 | granularity: int = 8
29 | raw_prune_score: str = "L1" # [L1, L2]
30 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/constants.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Set of constants commonly used across cv modules."""
16 |
17 | # List of valid image extensions
18 | VALID_IMAGE_EXTENSIONS = (".jpg", ".jpeg", ".png", ".bmp", ".JPEG", ".JPG", ".PNG")
19 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Entrypoint Modules."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/hydra/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Common Hydra Modules."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/logging/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Common Logging Modules."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Common Proto Modules."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/adam_optimizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying ADAM optimizer parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message AdamOptimizerConfig {
10 | float epsilon = 1;
11 | float beta1 = 2;
12 | float beta2 = 3;
13 | bool amsgrad = 4;
14 | }
15 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/class_weighting_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message ClassWeightingConfig {
6 |
7 | map class_weighting = 1;
8 |
9 | //Placeholder
10 | bool enable_auto = 2;
11 | }
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/clearml_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * clearml_config.proto: Protocol buffer definition for
5 | * training visualizations over clearml.
6 | */
7 |
8 | syntax = "proto3";
9 |
10 | message ClearMLConfig {
11 | // Master switch.
12 | string project = 1;
13 | string task = 2;
14 | repeated string tags = 3;
15 | bool reuse_last_task_id = 4;
16 | bool continue_last_task = 5;
17 | bool deferred_init = 6;
18 | }
19 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/cost_scaling_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying cost scaling parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message CostScalingConfig {
10 |
11 | bool enabled = 1;
12 |
13 | double initial_exponent = 2;
14 |
15 | double increment = 3;
16 |
17 | double decrement = 4;
18 | }
19 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/detection_sequence_dataset_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message DataSource
6 | {
7 | string label_directory_path = 1;
8 | string image_directory_path = 2;
9 | string root_path = 3;
10 | string tfrecords_path = 4;
11 | }
12 |
13 | message DatasetConfig {
14 | // Datasources
15 | // Note that paths should be relative to the DATA_ROOT path
16 | repeated DataSource data_sources = 1;
17 |
18 | map target_class_mapping = 2;
19 |
20 | repeated DataSource validation_data_sources = 3;
21 |
22 | bool include_difficult_in_training = 4;
23 |
24 | // data loader type: kitti or coco
25 | string type = 5;
26 | }
27 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/eval_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message EvalConfig {
6 | enum AP_MODE {
7 | SAMPLE = 0;
8 | INTEGRATE = 1;
9 | }
10 | AP_MODE average_precision_mode = 1;
11 | uint32 batch_size = 2;
12 | float matching_iou_threshold = 3;
13 | bool visualize_pr_curve = 4;
14 | }
15 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/learning_rate_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying learning rate schedule parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | import "nvidia_tao_deploy/cv/common/proto/soft_start_annealing_schedule_config.proto";
10 | import "nvidia_tao_deploy/cv/common/proto/soft_start_cosine_annealing_schedule_config.proto";
11 |
12 | message LearningRateConfig {
13 | oneof learning_rate {
14 | SoftStartAnnealingScheduleConfig soft_start_annealing_schedule = 1;
15 | SoftStartCosineAnnealingScheduleConfig soft_start_cosine_annealing_schedule = 2;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/nms_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message NMSConfig {
6 | float confidence_threshold = 1;
7 | float clustering_iou_threshold = 2;
8 | uint32 top_k = 3;
9 | uint32 infer_nms_score_bits = 4;
10 | bool force_on_cpu = 5;
11 | }
12 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/optimizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying optimizer parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | import "nvidia_tao_deploy/cv/common/proto/sgd_optimizer_config.proto";
10 | import "nvidia_tao_deploy/cv/common/proto/adam_optimizer_config.proto";
11 | import "nvidia_tao_deploy/cv/common/proto/rmsprop_optimizer_config.proto";
12 |
13 | message OptimizerConfig {
14 | oneof optimizer {
15 | AdamOptimizerConfig adam = 1;
16 | SGDOptimizerConfig sgd = 2;
17 | RMSpropOptimizerConfig rmsprop = 3;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/regularizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying regularizer parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message RegularizerConfig {
10 |
11 | enum RegularizationType {
12 | NO_REG = 0;
13 | L1 = 1;
14 | L2 = 2;
15 | }
16 |
17 | RegularizationType type = 1;
18 |
19 | float weight = 2;
20 | }
21 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/rmsprop_optimizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying ADAM optimizer parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message RMSpropOptimizerConfig {
10 | float rho = 1;
11 | float momentum = 2;
12 | float epsilon = 3;
13 | bool centered = 4;
14 | }
15 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/sgd_optimizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying ADAM optimizer parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message SGDOptimizerConfig {
10 | float momentum = 1;
11 | bool nesterov = 2;
12 | }
13 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/soft_start_annealing_schedule_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying soft start annealing learning rate schedule parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message SoftStartAnnealingScheduleConfig {
10 | // Learning rate at the beginning and the end of training.
11 | float min_learning_rate = 1;
12 |
13 | // Learning rate in the middle of training.
14 | float max_learning_rate = 2;
15 |
16 | // The progress at which learning rate achieves max_learning_rate. Progress is in the [0,1]
17 | // range.
18 | float soft_start = 3;
19 |
20 | // The progress at which learning rate starts to drop towards min_learning_rate.
21 | float annealing = 4;
22 | }
23 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/soft_start_cosine_annealing_schedule_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying softstart cosine annealing learning rate schedule parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message SoftStartCosineAnnealingScheduleConfig {
10 | // Learning rate at the beginning and the end of training.
11 | float max_learning_rate = 1;
12 |
13 | // soft_start: which point to reach base_lr
14 | float soft_start = 2;
15 |
16 | // min_learning_rate is minimum lr
17 | float min_learning_rate = 3;
18 | }
19 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/visualizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * visualizer_config.proto: Protocol buffer definition for training visualizations.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | import "nvidia_tao_deploy/cv/common/proto/wandb_config.proto";
10 | import "nvidia_tao_deploy/cv/common/proto/clearml_config.proto";
11 |
12 | message VisualizerConfig {
13 | // Master switch.
14 | bool enabled = 1;
15 |
16 | // Number of images to add to Tensorboard visualization.
17 | uint32 num_images = 2;
18 |
19 | //visualize histograms
20 | bool weight_histograms = 3;
21 |
22 | // configuration setting for weights and biases.
23 | WandBConfig wandb_config = 4;
24 |
25 | // configuration setting for clearml.
26 | ClearMLConfig clearml_config = 5;
27 | }
28 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/proto/wandb_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * wandb_config.proto: Protocol buffer definition for
5 | * training visualizations over weights and biases.
6 | */
7 |
8 | syntax = "proto3";
9 |
10 | message WandBConfig {
11 | // Master switch.
12 | bool enabled = 1;
13 | string key = 2;
14 | string project = 3;
15 | string entity = 4;
16 | bool reinit = 5;
17 | string name = 6;
18 | repeated string tags = 7;
19 | string wandb_dir = 8;
20 | string notes = 9;
21 | enum MODE {
22 | ONLINE = 0;
23 | OFFLINE = 1;
24 | DISABLED = 2;
25 | }
26 | MODE mode = 10;
27 | }
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/common/telemetry/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO utils for uploading telemetry data."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/deformable_detr/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy D-DETR."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/deformable_detr/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for D-DETR."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/deformable_detr/hydra_config/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy D-DETR Hydra."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/deformable_detr/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy D-DETR scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/deformable_detr/specs/evaluate.yaml:
--------------------------------------------------------------------------------
1 | encryption_key: "???"
2 | results_dir: "???"
3 | dataset:
4 | test_data_sources:
5 | image_dir: "???"
6 | json_file: "???"
7 | num_classes: 4
8 | batch_size: 10
9 | workers: 8
10 | eval_class_ids: [1]
11 | model:
12 | num_feature_levels: 2
13 | dec_layers: 6
14 | enc_layers: 6
15 | num_queries: 300
16 | with_box_refine: True
17 | evaluate:
18 | trt_engine: "???"
19 | conf_threshold: 0.0
20 | input_width: 960
21 | input_height: 544
22 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/deformable_detr/specs/gen_trt_engine.yaml:
--------------------------------------------------------------------------------
1 | encryption_key: "???"
2 | results_dir: "???"
3 | dataset:
4 | num_classes: 4
5 | batch_size: -1
6 | augmentation:
7 | input_std: [0.229, 0.224, 0.225]
8 | model:
9 | num_feature_levels: 2
10 | dec_layers: 6
11 | enc_layers: 6
12 | num_queries: 300
13 | with_box_refine: True
14 | aux_loss: False
15 | gen_trt_engine:
16 | gpu_id: 0
17 | onnx_file: "???"
18 | trt_engine: "???"
19 | input_channel: 3
20 | input_width: 960
21 | input_height: 544
22 | tensorrt:
23 | data_type: int8
24 | workspace_size: 1024
25 | min_batch_size: 1
26 | opt_batch_size: 10
27 | max_batch_size: 10
28 | calibration:
29 | cal_image_dir:
30 | - "???"
31 | cal_cache_file: "???"
32 | cal_batch_size: 10
33 | cal_batches: 1000
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/deformable_detr/specs/infer.yaml:
--------------------------------------------------------------------------------
1 | encryption_key: "???"
2 | results_dir: "???"
3 | dataset:
4 | infer_data_sources:
5 | image_dir:
6 | - "???"
7 | classmap: "???"
8 | num_classes: 4
9 | batch_size: 8
10 | workers: 8
11 | inference:
12 | trt_engine: "???"
13 | conf_threshold: 0.5
14 | input_width: 960
15 | input_height: 544
16 | color_map:
17 | person: green
18 | model:
19 | num_feature_levels: 2
20 | dec_layers: 6
21 | enc_layers: 6
22 | num_queries: 300
23 | with_box_refine: True
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy DetectNetv2."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for DetectNetv2."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/proto/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy DetectNetv2 Proto."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/proto/adam_optimizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying ADAM optimizer parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message AdamOptimizerConfig {
10 |
11 | float epsilon = 1;
12 |
13 | float beta1 = 2;
14 |
15 | float beta2 = 3;
16 | }
17 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/proto/bbox_rasterizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * bbox_rasterizer_config.proto: Protocol buffer definition for providing labels to bounding box
5 | * regression.
6 | *
7 | * Allows the user to specify:
8 | * -- Parameters for setting up the bounding box rasterizer.
9 | * -- Rasterizer parameters for each model target class.
10 | */
11 |
12 | syntax = "proto3";
13 |
14 | message BboxRasterizerConfig {
15 |
16 | message TargetClassConfig {
17 | // All attributes are required.
18 | // Names must match those of the target classes of CostFunctionParameters proto.
19 | // Order is not important.
20 | float cov_center_x = 1;
21 | float cov_center_y = 2;
22 |
23 | float cov_radius_x = 3;
24 | float cov_radius_y = 4;
25 |
26 | float bbox_min_radius = 5;
27 | }
28 |
29 | map target_class_config = 1;
30 |
31 | float deadzone_radius = 2;
32 | }
33 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/proto/coco_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2017-2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * coco_config.proto: Protocol buffer definition for specifying config for converting
5 | * COCO datasets to .tfrecords.
6 | *
7 | * Allows the user to specify:
8 | * -- Path to images and labels
9 | * -- Class mapping
10 | * -- Number of partitions (folds) and shards
11 | */
12 |
13 | syntax = "proto3";
14 |
15 | message COCOConfig {
16 | string root_directory_path = 1;
17 |
18 | // list of image directories for each partiition.
19 | repeated string img_dir_names = 2;
20 |
21 | // list of annotations JSON files for each partition
22 | repeated string annotation_files = 3;
23 |
24 | uint32 num_partitions = 4;
25 | repeated uint32 num_shards = 5;
26 | }
27 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/proto/cost_scaling_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying cost scaling parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message CostScalingConfig {
10 |
11 | bool enabled = 1;
12 |
13 | double initial_exponent = 2;
14 |
15 | double increment = 3;
16 |
17 | double decrement = 4;
18 | }
19 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/proto/early_stopping_annealing_schedule_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying early stopping annealing learning rate schedule parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message EarlyStoppingAnnealingScheduleConfig {
10 | // Learning rate at the beginning and the end of training.
11 | float min_learning_rate = 1;
12 |
13 | // Learning rate in the middle of training.
14 | float max_learning_rate = 2;
15 |
16 | // The number of epochs after which learning rate achieves max_learning_rate.
17 | uint32 soft_start_epochs = 3;
18 |
19 | // The number of epochs after which learning rate starts to drop towards min_learning_rate.
20 | uint32 annealing_epochs = 4;
21 |
22 | // The number of steps after which we drop learning rate or stop training if we
23 | // see no improvement in validation loss.
24 | uint32 patience_steps = 5;
25 | }
26 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/proto/kitti_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * kitti_config.proto: Protocol buffer definition for specifying config for converting
5 | * KITTI datasets to .tfrecords.
6 | *
7 | * Allows the user to specify:
8 | * -- Path to images and labels
9 | * -- Class mapping
10 | * -- Number of partitions (folds) and shards
11 | */
12 |
13 | syntax = "proto3";
14 |
15 | message KITTIConfig {
16 |
17 | // PATH TO FILES
18 | string root_directory_path = 1;
19 | string image_dir_name = 2;
20 | string label_dir_name = 3;
21 | string point_clouds_dir = 4;
22 | string calibrations_dir = 5;
23 | string kitti_sequence_to_frames_file = 6;
24 | string image_extension = 7;
25 |
26 | // The number of partitions (folds) and shards.
27 | uint32 num_partitions = 8;
28 | uint32 num_shards = 9;
29 | string partition_mode = 10;
30 | float val_split = 11;
31 | }
32 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/proto/learning_rate_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying learning rate schedule parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | import "nvidia_tao_deploy/cv/detectnet_v2/proto/soft_start_annealing_schedule_config.proto";
10 | import "nvidia_tao_deploy/cv/detectnet_v2/proto/early_stopping_annealing_schedule_config.proto";
11 |
12 | message LearningRateConfig {
13 | oneof learning_rate {
14 | SoftStartAnnealingScheduleConfig soft_start_annealing_schedule = 1;
15 | // If set, use early stopping learning rate. Regular validation hook/AP
16 | // computation will not be executed.
17 | EarlyStoppingAnnealingScheduleConfig early_stopping_annealing_schedule = 2;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/proto/objective_label_filter.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * objective_label_filter.proto: Contains necessary info to define a structure that will apply the
5 | * defined filters to the correct classes and objectives.
6 | */
7 |
8 | syntax = "proto3";
9 |
10 | import "nvidia_tao_deploy/cv/detectnet_v2/proto/label_filter.proto";
11 |
12 | message ObjectiveLabelFilter {
13 |
14 | // Extend original LabelFilter proto with fields pertaining to the model.
15 | message ObjectiveLabelFilterConfig {
16 | LabelFilter label_filter = 1;
17 |
18 | repeated string target_class_names = 2;
19 | repeated string objective_names = 3;
20 | }
21 |
22 | repeated ObjectiveLabelFilterConfig objective_label_filter_configs = 1;
23 | float mask_multiplier = 2;
24 | bool preserve_ground_truth = 3;
25 | }
26 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/proto/optimizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying optimizer parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | import "nvidia_tao_deploy/cv/detectnet_v2/proto/adam_optimizer_config.proto";
10 |
11 | message OptimizerConfig {
12 | oneof optimizer {
13 | AdamOptimizerConfig adam = 1;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/proto/regularizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying regularizer parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message RegularizerConfig {
10 |
11 | enum RegularizationType {
12 | NO_REG = 0;
13 | L1 = 1;
14 | L2 = 2;
15 | }
16 |
17 | RegularizationType type = 1;
18 |
19 | float weight = 2;
20 | }
21 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/proto/soft_start_annealing_schedule_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying soft start annealing learning rate schedule parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message SoftStartAnnealingScheduleConfig {
10 | // Learning rate at the beginning and the end of training.
11 | float min_learning_rate = 1;
12 |
13 | // Learning rate in the middle of training.
14 | float max_learning_rate = 2;
15 |
16 | // The progress at which learning rate achieves max_learning_rate. Progress is in the [0,1]
17 | // range.
18 | float soft_start = 3;
19 |
20 | // The progress at which learning rate starts to drop towards min_learning_rate.
21 | float annealing = 4;
22 | }
23 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/proto/visualizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * visualizer_config.proto: Protocol buffer definition for training visualizations.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | import "nvidia_tao_deploy/cv/common/proto/clearml_config.proto";
10 | import "nvidia_tao_deploy/cv/common/proto/wandb_config.proto";
11 |
12 | message VisualizerConfig {
13 | // Master switch.
14 | bool enabled = 1;
15 |
16 | // Number of images to add to Tensorboard visualization.
17 | uint32 num_images = 2;
18 | uint32 scalar_logging_frequency = 3;
19 | uint32 infrequent_logging_frequency = 4;
20 |
21 | message TargetClassConfig {
22 | // Grid cells with coverage lower than this threshold will be ignored.
23 | // Set this to the same value as ClusteringConfig.coverage_threshold to
24 | // match clustering input.
25 | float coverage_threshold = 1;
26 | }
27 | map target_class_config = 5;
28 |
29 | WandBConfig wandb_config = 6;
30 |
31 | ClearMLConfig clearml_config = 7;
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/detectnet_v2/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy DetectNetv2 scripts module."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/dino/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy DINO."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/dino/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for DINO."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/dino/hydra_config/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | """TAO Deploy DINO Hydra."""
17 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/dino/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy DINO scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/dino/specs/evaluate.yaml:
--------------------------------------------------------------------------------
1 | encryption_key: "???"
2 | results_dir: "???"
3 | dataset:
4 | test_data_sources:
5 | image_dir: "???"
6 | json_file: "???"
7 | num_classes: 4
8 | batch_size: 10
9 | workers: 8
10 | eval_class_ids: [1]
11 | evaluate:
12 | trt_engine: "???"
13 | conf_threshold: 0.0
14 | input_width: 960
15 | input_height: 544
16 | model:
17 | backbone: fan_small
18 | num_feature_levels: 4
19 | dec_layers: 6
20 | enc_layers: 6
21 | num_queries: 900
22 | dropout_ratio: 0.0
23 | dim_feedforward: 2048
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/dino/specs/gen_trt_engine.yaml:
--------------------------------------------------------------------------------
1 | encryption_key: "???"
2 | results_dir: "???"
3 | dataset:
4 | num_classes: 4
5 | batch_size: -1
6 | augmentation:
7 | input_std: [0.229, 0.224, 0.225]
8 | model:
9 | backbone: fan_small
10 | num_feature_levels: 4
11 | dec_layers: 6
12 | enc_layers: 6
13 | num_queries: 900
14 | dropout_ratio: 0.0
15 | dim_feedforward: 2048
16 | gen_trt_engine:
17 | gpu_id: 0
18 | onnx_file: "???"
19 | trt_engine: "???"
20 | input_channel: 3
21 | input_width: 960
22 | input_height: 544
23 | tensorrt:
24 | data_type: int8
25 | workspace_size: 1024
26 | min_batch_size: 1
27 | opt_batch_size: 10
28 | max_batch_size: 10
29 | calibration:
30 | cal_image_dir:
31 | - "???"
32 | cal_cache_file: "???"
33 | cal_batch_size: 10
34 | cal_batches: 1000
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/dino/specs/infer.yaml:
--------------------------------------------------------------------------------
1 | encryption_key: "???"
2 | results_dir: "???"
3 | dataset:
4 | infer_data_sources:
5 | image_dir:
6 | - "???"
7 | classmap: "???"
8 | num_classes: 4
9 | batch_size: 8
10 | workers: 8
11 | inference:
12 | trt_engine: "???"
13 | conf_threshold: 0.5
14 | input_width: 960
15 | input_height: 544
16 | color_map:
17 | person: green
18 | model:
19 | backbone: fan_small
20 | num_feature_levels: 4
21 | dec_layers: 6
22 | enc_layers: 6
23 | num_queries: 900
24 | dropout_ratio: 0.0
25 | dim_feedforward: 2048
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/efficientdet_tf1/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy EfficientDet."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/efficientdet_tf1/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for efficientdet."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/efficientdet_tf1/proto/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy EfficientDet TF1 Proto."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/efficientdet_tf1/proto/aug_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message AugConfig {
6 | //required
7 | bool rand_hflip = 1;
8 | float random_crop_min_scale = 2;
9 | float random_crop_max_scale = 3;
10 | }
11 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/efficientdet_tf1/proto/dataset_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message DatasetConfig {
6 | //required
7 | string training_file_pattern = 1;
8 | string validation_file_pattern = 2;
9 | string validation_json_file = 3;
10 | string testdev_dir = 4;
11 | uint32 num_classes = 5;
12 | string image_size = 6; // "H, W"
13 | bool use_fake_data = 7;
14 | uint32 max_instances_per_image = 8;
15 | bool skip_crowd_during_training = 9;
16 | }
17 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/efficientdet_tf1/proto/eval_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message EvalConfig {
6 | //required
7 | uint32 min_eval_interval = 1;
8 | uint32 eval_timeout = 2;
9 | uint32 eval_batch_size = 3;
10 | uint32 eval_epoch_cycle = 4;
11 | bool eval_after_training = 5;
12 | uint32 eval_samples = 6;
13 | float min_score_thresh = 7;
14 | uint32 max_detections_per_image = 8;
15 | }
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/efficientdet_tf1/proto/experiment.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * experiment.proto: Protocol buffer definition for a top-level message
5 | * encapsulating multiple other message types to form a complete specification
6 | * for an EfficientDet experiment.
7 | */
8 |
9 | syntax = "proto3";
10 |
11 | import "nvidia_tao_deploy/cv/efficientdet_tf1/proto/aug_config.proto";
12 | import "nvidia_tao_deploy/cv/efficientdet_tf1/proto/dataset_config.proto";
13 | import "nvidia_tao_deploy/cv/efficientdet_tf1/proto/eval_config.proto";
14 | import "nvidia_tao_deploy/cv/efficientdet_tf1/proto/model_config.proto";
15 | import "nvidia_tao_deploy/cv/efficientdet_tf1/proto/training_config.proto";
16 |
17 | message Experiment {
18 |
19 | // Set-up dataloader configuration.
20 | DatasetConfig dataset_config = 1;
21 |
22 | // Set-up training op.
23 | TrainingConfig training_config = 2;
24 |
25 | // Eval
26 | EvalConfig eval_config = 3;
27 |
28 | // Augmentation
29 | AugConfig augmentation_config = 4;
30 |
31 | // Eval
32 | ModelConfig model_config = 5;
33 |
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/efficientdet_tf1/proto/model_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message ModelConfig {
6 | //required
7 | string model_name = 1;
8 | bool freeze_bn = 2;
9 | string freeze_blocks = 3;
10 | string aspect_ratios = 4;
11 | float anchor_scale = 5;
12 | uint32 min_level = 6;
13 | uint32 max_level = 7;
14 | uint32 num_scales = 8;
15 | }
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/efficientdet_tf1/proto/training_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message TrainingConfig {
6 | //required
7 | uint32 train_batch_size = 1;
8 | uint32 iterations_per_loop = 2;
9 | bool use_xla = 3;
10 | bool disable_logging = 4;
11 | string checkpoint = 5;
12 | uint32 stop_at_epoch = 6;
13 | bool resume = 7;
14 | uint32 checkpoint_period = 8;
15 | uint32 keep_checkpoint_max = 9;
16 | uint32 num_examples_per_epoch = 10;
17 | uint32 num_epochs = 11;
18 | string skip_checkpoint_variables = 12;
19 | uint32 profile_skip_steps = 13;
20 | uint32 tf_random_seed = 14;
21 | float moving_average_decay = 15;
22 | float lr_warmup_epoch = 16;
23 | float lr_warmup_init = 17;
24 | float learning_rate = 18;
25 | bool amp = 19;
26 | float l2_weight_decay = 20;
27 | float l1_weight_decay = 21;
28 | string pruned_model_path = 22;
29 | float clip_gradients_norm = 23;
30 | float momentum = 24;
31 | uint32 logging_frequency = 25;
32 | }
33 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/efficientdet_tf1/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy TF1 EfficientDet scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/efficientdet_tf1/specs/experiment_spec.txt:
--------------------------------------------------------------------------------
1 | dataset_config {
2 | num_classes: 2
3 | image_size: "544,960"
4 | validation_json_file: "/home/scratch.p3/yuw/maskrcnn_backup/datasets/avlp_car16.json"
5 | }
6 | eval_config {
7 | min_score_thresh: 0.0001
8 | eval_batch_size: 1
9 | eval_samples: 500
10 | }
11 | model_config {
12 | model_name: 'efficientdet-d0'
13 | }
14 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/efficientdet_tf2/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy EfficientDet."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/efficientdet_tf2/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for efficientdet."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/efficientdet_tf2/hydra_config/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy EfficientDet Hydra."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/efficientdet_tf2/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy TF2 EfficientDet scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/faster_rcnn/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy FRCNN."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/faster_rcnn/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for faster rcnn."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/faster_rcnn/proto/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy FRCNN Proto."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/faster_rcnn/proto/evaluation.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | //evaluation config
4 |
5 | syntax = "proto3";
6 |
7 | import "nvidia_tao_deploy/cv/faster_rcnn/proto/trt_config.proto";
8 |
9 | message IoUThresholdRange {
10 | float start = 1;
11 | float end = 2;
12 | float step = 3;
13 | }
14 |
15 |
16 | message EvaluationConfig {
17 | string model = 3;
18 | uint32 rpn_pre_nms_top_N = 12;
19 | uint32 rpn_nms_max_boxes = 6;
20 | float rpn_nms_overlap_threshold = 7;
21 | uint32 classifier_nms_max_boxes = 8;
22 | float classifier_nms_overlap_threshold = 9;
23 | float object_confidence_thres = 11;
24 | bool use_voc07_11point_metric = 13;
25 | uint32 validation_period_during_training = 15;
26 | uint32 batch_size = 16;
27 | TrtInference trt_evaluation = 17;
28 | oneof iou_threshold_config {
29 | IoUThresholdRange gt_matching_iou_threshold_range = 18;
30 | float gt_matching_iou_threshold = 19;
31 | }
32 | bool visualize_pr_curve = 20;
33 | }
34 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/faster_rcnn/proto/inference.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | //inference config
4 |
5 | syntax = "proto3";
6 |
7 | import "nvidia_tao_deploy/cv/faster_rcnn/proto/trt_config.proto";
8 |
9 |
10 | message InferenceConfig {
11 | string images_dir = 1; //directory of images
12 | string model = 2;
13 | uint32 batch_size = 15;
14 | uint32 rpn_pre_nms_top_N = 10;
15 | uint32 rpn_nms_max_boxes = 7;
16 | float rpn_nms_overlap_threshold = 8;
17 | float bbox_visualize_threshold = 5;
18 | float object_confidence_thres = 16;
19 | uint32 classifier_nms_max_boxes = 9;
20 | float classifier_nms_overlap_threshold = 6;
21 | string detection_image_output_dir = 11;
22 | bool bbox_caption_on = 12;
23 | string labels_dump_dir = 13;
24 | TrtInference trt_inference = 14;
25 | uint32 nms_score_bits = 17;
26 | }
27 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/faster_rcnn/proto/input_image.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | //proto for the input_image
4 |
5 | syntax = "proto3";
6 |
7 | message ImageSizeConfigMin {
8 | uint32 min = 1;
9 | }
10 |
11 | message ImageSizeConfigHeightWidth{
12 | uint32 height = 1;
13 | uint32 width =2;
14 | }
15 |
16 | // image type
17 | enum ImageType {
18 | RGB = 0;
19 | GRAY_SCALE = 1;
20 | }
21 |
22 | message InputImageConfig {
23 | ImageType image_type = 6;
24 | //image size config
25 | oneof image_size_config{
26 | ImageSizeConfigMin size_min = 1;
27 | ImageSizeConfigHeightWidth size_height_width = 2;
28 | }
29 |
30 | //image channel mean
31 | string image_channel_order = 5;
32 | map image_channel_mean = 3;
33 | float image_scaling_factor = 4;
34 | uint32 max_objects_num_per_image = 7;
35 | }
36 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/faster_rcnn/proto/learning_rate.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | //learning rate scheduler config
4 |
5 | syntax = "proto3";
6 |
7 |
8 | message SoftStartAnnealingConfig {
9 | float base_lr = 1;
10 | float start_lr = 2;
11 | float soft_start = 3;
12 | repeated float annealing_points = 4;
13 | float annealing_divider = 5;
14 | }
15 |
16 | message StepLrConfig {
17 | float base_lr = 1;
18 | float gamma = 2;
19 | float step_size = 3;
20 | }
21 |
22 | message LRConfig {
23 | oneof lr_config {
24 | SoftStartAnnealingConfig soft_start = 1;
25 | StepLrConfig step = 2;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/faster_rcnn/proto/optimizer.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | //optimizer config
4 |
5 | syntax = "proto3";
6 |
7 | message AdamOptimizerConfig {
8 | float lr = 1;
9 | float beta_1 = 2;
10 | float beta_2 = 3;
11 | float epsilon = 4;
12 | float decay = 5;
13 | bool amsgrad = 6;
14 | }
15 |
16 | message SgdOptimizerConfig {
17 | float lr = 1;
18 | float momentum = 2;
19 | float decay = 3;
20 | bool nesterov = 4;
21 | }
22 |
23 | message RmspropOptimizerConfig {
24 | float lr = 1;
25 | }
26 |
27 | message OptimizerConfig {
28 | oneof optim {
29 | AdamOptimizerConfig adam = 1;
30 | SgdOptimizerConfig sgd = 2;
31 | RmspropOptimizerConfig rmsprop = 3;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/faster_rcnn/proto/regularizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying regularizer parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message RegularizerConfig {
10 |
11 | enum RegularizationType {
12 | NO_REG = 0;
13 | L1 = 1;
14 | L2 = 2;
15 | }
16 |
17 | RegularizationType type = 1;
18 |
19 | float weight = 2;
20 | }
21 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/faster_rcnn/proto/trt_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | //tensorrt inference config
4 |
5 | syntax = "proto3";
6 |
7 | message TrtInference {
8 | string trt_engine = 1;
9 | }
10 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/faster_rcnn/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy FRCNN scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/grounding_dino/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Grounding DINO."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/grounding_dino/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for DINO."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/grounding_dino/hydra_config/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | """TAO Deploy DINO Hydra."""
17 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/grounding_dino/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Grounding DINO scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/grounding_dino/specs/evaluate.yaml:
--------------------------------------------------------------------------------
1 | results_dir: /home/scratch.p3/sean/groundingdino/tao_integration/
2 | dataset:
3 | test_data_sources:
4 | image_dir: /home/scratch.p3/sean/datasets/coco/raw-data/val2017/
5 | json_file: /home/scratch.p3/sean/datasets/coco/raw-data/annotations/instances_val2017_remapped.json
6 | batch_size: 4
7 | workers: 8
8 | evaluate:
9 | trt_engine: /home/scratch.p3/sean/groundingdino/tao_integration/swint2.engine
10 | input_width: 960
11 | input_height: 544
12 | model:
13 | backbone: swin_tiny_224_1k
14 | num_feature_levels: 4
15 | dec_layers: 6
16 | enc_layers: 6
17 | num_queries: 900
18 | dropout_ratio: 0.0
19 | dim_feedforward: 2048
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/grounding_dino/specs/gen_trt_engine.yaml:
--------------------------------------------------------------------------------
1 | results_dir: /home/scratch.p3/sean/groundingdino/tao_integration/
2 | dataset:
3 | batch_size: -1
4 | augmentation:
5 | input_std: [0.229, 0.224, 0.225]
6 | gen_trt_engine:
7 | gpu_id: 0
8 | onnx_file: /home/scratch.p3/sean/groundingdino/tao_integration/swint2.onnx
9 | trt_engine: /home/scratch.p3/sean/groundingdino/tao_integration/swint2.engine
10 | input_channel: 3
11 | input_width: 960
12 | input_height: 544
13 | tensorrt:
14 | data_type: fp32
15 | workspace_size: 10240
16 | min_batch_size: 1
17 | opt_batch_size: 4
18 | max_batch_size: 4
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/grounding_dino/specs/infer.yaml:
--------------------------------------------------------------------------------
1 | results_dir: /home/scratch.p3/sean/groundingdino/tao_integration/
2 | dataset:
3 | infer_data_sources:
4 | image_dir:
5 | # - /home/projects2_metropolis/datasets/kpi_datasets/People/C0042_4.mp4/images_final_hres/
6 | - /home/scratch.p3/sean/temp/
7 | captions: ["dog", "cat"]
8 | batch_size: 4
9 | workers: 8
10 | inference:
11 | trt_engine: /home/scratch.p3/sean/groundingdino/tao_integration/swint2.engine
12 | conf_threshold: 0.3
13 | input_width: 960
14 | input_height: 544
15 | color_map:
16 | "dog": green
17 | "cat": red
18 | model:
19 | backbone: swin_tiny_224_1k
20 | num_feature_levels: 4
21 | dec_layers: 6
22 | enc_layers: 6
23 | num_queries: 900
24 | dropout_ratio: 0.0
25 | dim_feedforward: 2048
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/lprnet/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy LPRNet."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/lprnet/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for lprnet."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/lprnet/proto/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy LPRNet Proto."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/lprnet/proto/augmentation_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | //next index: 10
6 | message AugmentationConfig {
7 | int32 output_width=1;
8 | int32 output_height=2;
9 | int32 output_channel=3;
10 |
11 | int32 max_rotate_degree=4;
12 | float rotate_prob=6;
13 | repeated int32 gaussian_kernel_size=7;
14 | float blur_prob=8;
15 | float reverse_color_prob=9;
16 | float keep_original_prob=5;
17 | }
18 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/lprnet/proto/eval_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message EvalConfig {
6 | //required
7 | uint32 validation_period_during_training = 1;
8 | uint32 batch_size = 2;
9 | }
10 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/lprnet/proto/experiment.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * experiment.proto: Protocol buffer definition for a top-level message
5 | * encapsulating multiple other message types to form a complete specification
6 | * for an SSD experiment.
7 | */
8 |
9 | syntax = "proto3";
10 |
11 | import "nvidia_tao_deploy/cv/common/proto/training_config.proto";
12 | import "nvidia_tao_deploy/cv/lprnet/proto/lp_sequence_dataset_config.proto";
13 | import "nvidia_tao_deploy/cv/lprnet/proto/augmentation_config.proto";
14 | import "nvidia_tao_deploy/cv/lprnet/proto/eval_config.proto";
15 | import "nvidia_tao_deploy/cv/lprnet/proto/lpr_config.proto";
16 |
17 | message Experiment {
18 |
19 | uint32 random_seed = 1;
20 |
21 | // Set-up dataloader configuration.
22 | LPDatasetConfig dataset_config = 2;
23 | AugmentationConfig augmentation_config = 3;
24 |
25 | // Set-up training op.
26 | TrainingConfig training_config = 4;
27 |
28 | // Optional
29 | EvalConfig eval_config = 5;
30 |
31 | // Required
32 | LPRNetConfig lpr_config = 6;
33 |
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/lprnet/proto/lp_sequence_dataset_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message DataSource
6 | {
7 | string label_directory_path = 1;
8 | string image_directory_path = 2;
9 | }
10 |
11 | message LPDatasetConfig {
12 | // Datasources
13 | // Note that paths should be relative to the DATA_ROOT path
14 | repeated DataSource data_sources = 1;
15 |
16 | string characters_list_file = 2;
17 |
18 | repeated DataSource validation_data_sources = 3;
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/lprnet/proto/lpr_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | //7
6 | message LPRNetConfig {
7 | //optional
8 | uint32 sequence_length = 1; //deprecated
9 | uint32 hidden_units = 2;
10 | //optional
11 | uint32 max_label_length = 3;
12 |
13 | string arch = 4;
14 | uint32 nlayers = 5;
15 |
16 | repeated uint32 freeze_blocks = 6;
17 | bool freeze_bn = 7;
18 | }
19 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/lprnet/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy LPRNet scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask2former/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Mask2former."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask2former/d2/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Detectron2 packages and sources required in Mask2Former."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask2former/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for Mask2former."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask2former/hydra_config/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Default config file."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask2former/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Mask2former TAO-deploy scripts."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask2former/specs/gen_trt_engine.yaml:
--------------------------------------------------------------------------------
1 | results_dir: "/tao_experiments/mask2former_coco_effvit/"
2 | gen_trt_engine:
3 | gpu_id: 0
4 | onnx_file: "/tao_experiments/mask2former_swinl/train/model_epoch=129-v1.onnx"
5 | trt_engine: "/tao_experiments/mask2former_swinl/train/model_epoch=129-v1.fp16.engine"
6 | input_channel: 3
7 | input_width: 640
8 | input_height: 640
9 | tensorrt:
10 | data_type: fp16
11 | workspace_size: 1024
12 | min_batch_size: 1
13 | opt_batch_size: 1
14 | max_batch_size: 1
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask2former/specs/infer.yaml:
--------------------------------------------------------------------------------
1 | results_dir: /tao_experiments/mask2former_swinl/
2 | dataset:
3 | label_map: /tao_experiments/mask2former_swinl/colormap.json
4 | contiguous_id: False
5 | type: 'ade'
6 | val:
7 | name: "ade_val"
8 | annot_file: "/datasets/ade_val.jsonl"
9 | root_dir: ""
10 | batch_size: 1
11 | num_workers: 2
12 | test:
13 | img_dir: /tmp/odise_test_images/
14 | batch_size: 1
15 | model:
16 | object_mask_threshold: 0.0
17 | overlap_threshold: 0.8
18 | sem_seg_head:
19 | norm: "GN"
20 | num_classes: 150
21 | inference:
22 | trt_engine: "/tao_experiments/mask2former_swinl/train/model_epoch=129-v1.fp16.engine"
23 | evaluate:
24 | trt_engine: "/tao_experiments/mask2former_swinl/train/model_epoch=129-v1.fp16.engine"
25 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask_grounding_dino/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Mask Grounding DINO."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask_grounding_dino/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for Mask GroundingDINO."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask_grounding_dino/hydra_config/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | """TAO Deploy Mask GroundingDINO Hydra."""
17 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask_grounding_dino/metrics/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Mask Grounding DINO evaluation metrics."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask_grounding_dino/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Mask Grounding DINO scripts module."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask_grounding_dino/specs/evaluate.yaml:
--------------------------------------------------------------------------------
1 | results_dir: "???"
2 | dataset:
3 | test_data_sources:
4 | image_dir: "???"
5 | json_file: "???"
6 | batch_size: 1
7 | workers: 8
8 | evaluate:
9 | trt_engine: "???"
10 | input_width: 960
11 | input_height: 544
12 | conf_threshold: 0.5
13 | model:
14 | backbone: swin_tiny_224_1k
15 | num_feature_levels: 4
16 | dec_layers: 6
17 | enc_layers: 6
18 | num_queries: 900
19 | dropout_ratio: 0.0
20 | dim_feedforward: 2048
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask_grounding_dino/specs/gen_trt_engine.yaml:
--------------------------------------------------------------------------------
1 | results_dir: "???"
2 | dataset:
3 | batch_size: -1
4 | augmentation:
5 | input_std: [0.229, 0.224, 0.225]
6 | gen_trt_engine:
7 | gpu_id: 0
8 | onnx_file: "???"
9 | trt_engine: "???"
10 | input_channel: 3
11 | input_width: 960
12 | input_height: 544
13 | batch_size: -1
14 | tensorrt:
15 | data_type: fp32
16 | workspace_size: 10240
17 | min_batch_size: 1
18 | opt_batch_size: 1
19 | max_batch_size: 2
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask_rcnn/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy MRCNN."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask_rcnn/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for mask rcnn."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask_rcnn/proto/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | """TAO Deploy MRCNN Proto."""
17 |
18 | from __future__ import absolute_import
19 | from __future__ import division
20 | from __future__ import print_function
21 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask_rcnn/proto/data_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message DataConfig {
6 | string image_size = 1;
7 | bool augment_input_data = 2;
8 | uint32 num_classes = 3;
9 | bool skip_crowd_during_training = 4;
10 | // bool use_category = 5;
11 | string training_file_pattern = 6;
12 | string validation_file_pattern = 7;
13 | string val_json_file = 8;
14 | uint32 eval_samples = 9;
15 | uint32 prefetch_buffer_size = 10;
16 | uint32 shuffle_buffer_size = 11;
17 | uint32 n_workers = 12;
18 | uint32 max_num_instances = 13;
19 | }
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask_rcnn/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Mask RCNN scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/mask_rcnn/specs/experiment_spec.txt:
--------------------------------------------------------------------------------
1 | eval_batch_size: 8
2 | data_config{
3 | image_size: "(576, 960)"
4 | eval_samples: 500
5 | val_json_file: "/home/scratch.p3/datasets/astro17/valid_mask_final.json"
6 | # dataset specific parameters
7 | num_classes: 2
8 | }
9 | maskrcnn_config {
10 | # Mask-RCNN heads.
11 | include_mask: True
12 | mrcnn_resolution: 28
13 |
14 | # evaluation
15 | test_detections_per_image: 100
16 | test_nms: 0.5
17 | test_rpn_pre_nms_topn: 1000
18 | test_rpn_post_nms_topn: 1000
19 | test_rpn_nms_thresh: 0.7
20 |
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/metric_learning_recognition/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Metric Learning Recognition."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/metric_learning_recognition/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for metric learning recognition."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/metric_learning_recognition/hydra_config/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Metric Learning Recognition Hydra."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/metric_learning_recognition/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Metric Learning Recognition scripts modules."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/metric_learning_recognition/specs/evaluate.yaml:
--------------------------------------------------------------------------------
1 | results_dir: "???"
2 | evaluate:
3 | trt_engine: "???"
4 | batch_size: 8
5 | topk: 5
6 | dataset:
7 | val_dataset:
8 | reference: "???"
9 | query: "???"
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/metric_learning_recognition/specs/gen_trt_engine.yaml:
--------------------------------------------------------------------------------
1 | results_dir: "???"
2 | dataset:
3 | val_dataset:
4 | reference: "???"
5 | query: "???"
6 | pixel_mean: [0.485, 0.456, 0.406]
7 | pixel_std: [0.226, 0.226, 0.226]
8 |
9 | gen_trt_engine:
10 | gpu_id: 0
11 | onnx_file: "???"
12 | trt_engine: "???"
13 | tensorrt:
14 | data_type: int8
15 | workspace_size: 1024
16 | min_batch_size: 1
17 | opt_batch_size: 10
18 | max_batch_size: 10
19 | calibration:
20 | cal_cache_file: "???"
21 | cal_batch_size: 16
22 | cal_batches: 100
23 | cal_image_dir:
24 | - "???"
25 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/metric_learning_recognition/specs/inference.yaml:
--------------------------------------------------------------------------------
1 | results_dir: "???"
2 | model:
3 | input_channels: 3
4 | input_width: 224
5 | input_height: 224
6 | inference:
7 | trt_engine: "???"
8 | batch_size: 10
9 | inference_input_type: classification_folder
10 | topk: 10
11 | dataset:
12 | val_dataset:
13 | reference: "???"
14 | query: "???"
15 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/multitask_classification/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Multitask Classification."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/multitask_classification/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for multitask classification."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/multitask_classification/proto/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Multitask Classification Proto."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/multitask_classification/proto/dataset_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message DataSource
6 | {
7 | string train_csv_path = 1;
8 | string image_directory_path = 2;
9 | string val_csv_path = 3;
10 | }
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/multitask_classification/proto/experiment.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * experiment.proto: Protocol buffer definition for a top-level message
5 | * encapsulating multiple other message types to form a complete specification
6 | * for a MClassification experiment.
7 | */
8 |
9 | syntax = "proto3";
10 |
11 | import "nvidia_tao_deploy/cv/common/proto/training_config.proto";
12 | import "nvidia_tao_deploy/cv/classification_tf1/proto/model_config.proto";
13 | import "nvidia_tao_deploy/cv/multitask_classification/proto/dataset_config.proto";
14 |
15 | message Experiment {
16 | DataSource dataset_config = 1;
17 | ModelConfig model_config = 2;
18 | TrainingConfig training_config = 3;
19 | uint32 random_seed = 4;
20 | }
21 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/multitask_classification/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Classification TF1 scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/multitask_classification/specs/experiment_spec.txt:
--------------------------------------------------------------------------------
1 | model_config {
2 | arch: "resnet",
3 | n_layers: 18
4 | # Setting these parameters to true to match the template downloaded from NGC.
5 | use_batch_norm: true
6 | all_projections: true
7 | freeze_blocks: 0
8 | freeze_blocks: 1
9 | input_image_size: "3,80,60"
10 | }
11 | train_config {
12 | preprocess_mode: "caffe"
13 | }
14 | eval_config {
15 | eval_dataset_path: "/home/projects1_metropolis/tmp/sean/22.04/classification_notebook/data/split/test"
16 | model_path: "/home/projects1_metropolis/tmp/sean/22.04/classification_notebook/output/weights/resnet_080.tlt"
17 | top_k: 3
18 | batch_size: 256
19 | n_workers: 8
20 | enable_center_crop: True
21 | }
22 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocdnet/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy OCDNet."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocdnet/data_loader/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Dataloader Init."""
16 | from __future__ import absolute_import
17 | from __future__ import division
18 | from __future__ import print_function
19 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocdnet/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for ocdnet."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocdnet/hydra_config/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy OCDNet Hydra."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocdnet/post_processing/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Init."""
16 | from __future__ import absolute_import
17 | from __future__ import division
18 | from __future__ import print_function
19 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocdnet/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy OCDNet scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocdnet/specs/evaluate.yaml:
--------------------------------------------------------------------------------
1 | model:
2 | load_pruned_graph: False
3 | pruned_graph_path: ''
4 |
5 | evaluate:
6 | results_dir: /results/evaluate
7 | checkpoint: /results/train/model_best.pth
8 | gpu_ids: [0]
9 | post_processing:
10 | type: SegDetectorRepresenter
11 | args:
12 | thresh: 0.3
13 | box_thresh: 0.55
14 | max_candidates: 1000
15 | unclip_ratio: 1.5
16 |
17 | metric:
18 | type: QuadMetric
19 | args:
20 | is_output_polygon: false
21 |
22 |
23 | dataset:
24 | validate_dataset:
25 | data_path: ['/data/test']
26 | args:
27 | pre_processes:
28 | - type: Resize2D
29 | args:
30 | short_size:
31 | - 1280
32 | - 736
33 | resize_text_polys: true
34 | img_mode: BGR
35 | filter_keys: []
36 | ignore_tags: ['*', '###']
37 | loader:
38 | batch_size: 1
39 | shuffle: false
40 | pin_memory: false
41 | num_workers: 4
42 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocdnet/specs/gen_trt_engine.yaml:
--------------------------------------------------------------------------------
1 | gen_trt_engine:
2 | width: 1280
3 | height: 736
4 | img_mode: BGR
5 | onnx_file: '???'
6 | trt_engine: /results/export/model_int8.engine
7 | tensorrt:
8 | data_type: int8
9 | min_batch_size: 1
10 | opt_batch_size: 1
11 | max_batch_size: 1
12 | calibration:
13 | cal_image_dir: /data/train/img
14 | cal_cache_file: /results/export/cal.bin
15 | cal_batch_size: 8
16 | cal_num_batches: 2
17 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocdnet/specs/inference.yaml:
--------------------------------------------------------------------------------
1 | model:
2 | load_pruned_graph: false
3 | pruned_graph_path: ''
4 |
5 | inference:
6 | checkpoint: '???'
7 | input_folder: /workspace/datasets/ICDAR2015/datasets/test/img
8 | width: 1280
9 | height: 736
10 | img_mode: BGR
11 | polygon: false
12 | show: false
13 | results_dir: /results/inference
14 |
15 | post_processing:
16 | type: SegDetectorRepresenter
17 | args:
18 | thresh: 0.3
19 | box_thresh: 0.55
20 | max_candidates: 1000
21 | unclip_ratio: 1.5
22 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocdnet/tensorrt_utils/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TensorRT utils for OCDNet."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocdnet/utils/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy OCDNet utils module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocdnet/utils/ocr_metric/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """get_metric module."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocdnet/utils/ocr_metric/icdar2015/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """icdar2015 module."""
16 | from .quad_metric import QuadMetric # noqa: F401
17 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocdnet/utils/ocr_metric/icdar2015/detection/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """icdar2015 detection module."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocrnet/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy OCRNet."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocrnet/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for ocrnet."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocrnet/hydra_config/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy OCRNet config."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocrnet/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy OCRNet scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocrnet/specs/infer.yaml:
--------------------------------------------------------------------------------
1 | engine: ./trt.engine
2 | batch_size: 1
3 | inference_images_dir: ./test_samples
4 | character_list_file: ./character_list.txt
5 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ocrnet/specs/trt.yaml:
--------------------------------------------------------------------------------
1 | model: /workspace/model.etlt
2 | save_engine_path: ./trt.engine
3 | encryption_key: nvidia_tao
4 | workspace_size: 2
5 | min_batch_size: 1
6 | opt_batch_size: 1
7 | max_batch_size: 1
8 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/optical_inspection/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy OpticalInpsection."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/optical_inspection/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for optical_inspection."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/optical_inspection/hydra_config/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy OpticalInpsection config."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/optical_inspection/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy OpticalInpsection scripts module."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/optical_inspection/specs/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Module containing default specification."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/retinanet/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy RetinaNet."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/retinanet/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for retinanet."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/retinanet/proto/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | """TAO Deploy RetinaNet Proto."""
17 |
18 | from __future__ import absolute_import
19 | from __future__ import division
20 | from __future__ import print_function
21 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/retinanet/proto/eval_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message EvalConfig {
6 | //required
7 | uint32 validation_period_during_training = 1;
8 | enum AP_MODE {
9 | SAMPLE = 0;
10 | INTEGRATE = 1;
11 | }
12 | AP_MODE average_precision_mode = 2;
13 | uint32 batch_size = 3;
14 | float matching_iou_threshold = 4;
15 | }
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/retinanet/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy RetinaNet scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/segformer/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Segformer."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/segformer/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for segformer."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/segformer/hydra_config/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Segformer Hydra."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/segformer/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Segformer scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/segformer/specs/infer.yaml:
--------------------------------------------------------------------------------
1 | model:
2 | input_height: 512
3 | input_width: 512
4 | backbone:
5 | type: "mit_b1"
6 | dataset:
7 | img_norm_cfg:
8 | mean:
9 | - 127.5
10 | - 127.5
11 | - 127.5
12 | std:
13 | - 127.5
14 | - 127.5
15 | - 127.5
16 | test_dataset:
17 | img_dir: "???"
18 | ann_dir: "???"
19 | input_type: "grayscale"
20 | data_root: /tlt-pytorch
21 | palette:
22 | - seg_class: foreground
23 | rgb:
24 | - 0
25 | - 0
26 | - 0
27 | label_id: 0
28 | mapping_class: foreground
29 | - seg_class: background
30 | rgb:
31 | - 255
32 | - 255
33 | - 255
34 | label_id: 1
35 | mapping_class: background
36 | batch_size: 1
37 | workers_per_gpu: 1
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ssd/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy SSD."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ssd/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for ssd."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ssd/entrypoint/ssd.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy command line wrapper to invoke CLI scripts."""
16 |
17 | import sys
18 | from nvidia_tao_deploy.cv.common.entrypoint.entrypoint_proto import launch_job
19 | import nvidia_tao_deploy.cv.ssd.scripts
20 |
21 |
22 | # TODO @seanf: how to get subtasks for proto?
23 |
24 | def main():
25 | """Function to launch the job."""
26 | launch_job(nvidia_tao_deploy.cv.ssd.scripts, "ssd", sys.argv[1:])
27 |
28 |
29 | if __name__ == "__main__":
30 | main()
31 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ssd/proto/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy SSD Proto."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ssd/proto/augmentation_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message AugmentationConfig {
6 | int32 output_width = 1;
7 | int32 output_height = 2;
8 | int32 output_channel = 3;
9 | float random_crop_min_scale = 4;
10 | float random_crop_max_scale = 5;
11 | float random_crop_min_ar = 6;
12 | float random_crop_max_ar = 7;
13 | float zoom_out_min_scale = 8;
14 | float zoom_out_max_scale = 9;
15 | int32 brightness = 10;
16 | float contrast = 11;
17 | float saturation = 12;
18 | int32 hue = 13;
19 | float random_flip = 14;
20 | map image_mean = 15;
21 | }
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ssd/proto/eval_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message EvalConfig {
6 | //required
7 | uint32 validation_period_during_training = 1;
8 | enum AP_MODE {
9 | SAMPLE = 0;
10 | INTEGRATE = 1;
11 | }
12 | AP_MODE average_precision_mode = 2;
13 | uint32 batch_size = 3;
14 | float matching_iou_threshold = 4;
15 | bool visualize_pr_curve = 5;
16 | }
17 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ssd/proto/ssd_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | //20
6 | message SSDConfig {
7 | //optional
8 | string aspect_ratios = 1;
9 | //optional
10 | string aspect_ratios_global = 2;
11 | //optional
12 | string scales = 3;
13 | //optional
14 | float min_scale = 4;
15 | float max_scale = 5;
16 | //required
17 | bool two_boxes_for_ar1 = 6;
18 | //required
19 | string steps = 7;
20 | //required
21 | bool clip_boxes = 8;
22 | //required
23 | string variances = 9;
24 | //required
25 | string offsets = 10;
26 | //required
27 | string mean_color = 11;
28 | string arch = 12;
29 | uint32 nlayers = 13;
30 | uint32 pred_num_channels = 14;
31 |
32 | //required
33 | float alpha = 15;
34 | float neg_pos_ratio = 16;
35 | float pos_iou_thresh = 17;
36 | float neg_iou_thresh = 20;
37 |
38 | repeated uint32 freeze_blocks = 18;
39 | bool freeze_bn = 19;
40 | }
41 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/ssd/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy SSD scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/unet/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy UNet."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/unet/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for unet."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/unet/entrypoint/unet.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy command line wrapper to invoke CLI scripts."""
16 |
17 | import sys
18 | from nvidia_tao_deploy.cv.common.entrypoint.entrypoint_proto import launch_job
19 | import nvidia_tao_deploy.cv.unet.scripts
20 |
21 |
22 | # TODO @seanf: how to get subtasks for proto?
23 |
24 | def main():
25 | """Function to launch the job."""
26 | launch_job(nvidia_tao_deploy.cv.unet.scripts, "unet", sys.argv[1:])
27 |
28 |
29 | if __name__ == "__main__":
30 | main()
31 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/unet/proto/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy UNet Proto."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/unet/proto/adam_optimizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying ADAM optimizer parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message AdamOptimizerConfig {
10 |
11 | float epsilon = 1;
12 |
13 | float beta1 = 2;
14 |
15 | float beta2 = 3;
16 | }
17 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/unet/proto/augmentation_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * augmentation_config.proto: Protocol buffer definition for data augmentation.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message AugmentationConfig
10 | {
11 | message SpatialAugmentation {
12 | // Probability of flipping an image horizontally/vertically.
13 | // Crop and Resize
14 | float hflip_probability = 1;
15 | float vflip_probability = 2;
16 | float crop_and_resize_prob = 3;
17 | float crop_and_resize_ratio = 4;
18 | }
19 | SpatialAugmentation spatial_augmentation = 2;
20 | message BrightnessAugmentation {
21 | // Standard deviation for color shift augmentation.
22 | float delta = 1;
23 | }
24 | BrightnessAugmentation brightness_augmentation =3;
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/unet/proto/data_class_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message DataClassConfig {
6 | message TargetClass {
7 | // The order of target classes in CostFunctionParameters defines the order
8 | // they appear in network predictions.
9 | string name = 1;
10 | float class_weight = 2;
11 | //train id from the image
12 | int32 label_id = 3;
13 | //the class to which a class needs to be mapped
14 | string mapping_class = 4;
15 | }
16 | repeated TargetClass target_classes = 1;
17 | }
18 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/unet/proto/experiment.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 |
4 | syntax = "proto3";
5 | import "nvidia_tao_deploy/cv/unet/proto/dataset_config.proto";
6 | import "nvidia_tao_deploy/cv/unet/proto/evaluation_config.proto";
7 | import "nvidia_tao_deploy/cv/unet/proto/model_config.proto";
8 | import "nvidia_tao_deploy/cv/unet/proto/training_config.proto";
9 | import "nvidia_tao_deploy/cv/unet/proto/data_class_config.proto";
10 |
11 | message Experiment {
12 |
13 | uint32 random_seed = 1;
14 |
15 | // Set-up the model config
16 | ModelConfig model_config = 5;
17 |
18 | // Set-up dataloader configuration.
19 | DatasetConfig dataset_config = 2;
20 |
21 | // Set-up evaluator.
22 | EvaluationConfig evaluation_config = 6;
23 |
24 | // Set-up training op.
25 | TrainingConfig training_config = 9;
26 |
27 | //Setting up the cost function config
28 | DataClassConfig data_class_config = 10;
29 |
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/unet/proto/optimizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying optimizer parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | import "nvidia_tao_deploy/cv/unet/proto/adam_optimizer_config.proto";
10 |
11 | message OptimizerConfig {
12 | oneof optimizer {
13 | AdamOptimizerConfig adam = 1;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/unet/proto/regularizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * Protocol buffer definition for specifying regularizer parameters.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message RegularizerConfig {
10 |
11 | enum RegularizationType {
12 | NO_REG = 0;
13 | L1 = 1;
14 | L2 = 2;
15 | }
16 |
17 | RegularizationType type = 1;
18 |
19 | float weight = 2;
20 | }
21 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/unet/proto/visualizer_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | /**
4 | * visualizer_config.proto: Protocol buffer definition for training visualizations.
5 | */
6 |
7 | syntax = "proto3";
8 |
9 | message VisualizerConfig {
10 | // Master switch.
11 | bool enabled = 1;
12 | uint32 save_summary_steps = 2;
13 | uint32 infrequent_save_summary_steps = 3;
14 | }
15 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/unet/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy UNet scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/visual_changenet/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Visual ChangeNet."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/visual_changenet/classification/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Visual ChangeNet-Classification module"""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/visual_changenet/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for Visual ChangeNet."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/visual_changenet/hydra_config/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Visual ChangeNet Hydra module."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/visual_changenet/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Visual ChangeNet scripts module."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/visual_changenet/segmentation/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Visual ChangeNet-Segmentation module"""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/visual_changenet/specs/classify/gen_trt_engine.yaml:
--------------------------------------------------------------------------------
1 | encryption_key: tlt_encode
2 | results_dir: "???"
3 | dataset:
4 | classify:
5 | batch_size: -1
6 | num_classes: 2
7 | model:
8 | backbone:
9 | type: "fan_small_12_p4_hybrid"
10 | gen_trt_engine:
11 | gpu_id: 0
12 | onnx_file: "???"
13 | trt_engine: "???"
14 | batch_size: -1
15 | input_channel: 3
16 | input_width: 128
17 | input_height: 512
18 | tensorrt:
19 | data_type: FP32
20 | workspace_size: 1024
21 | min_batch_size: 1
22 | opt_batch_size: 10
23 | max_batch_size: 10
24 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/visual_changenet/specs/segment/evaluate.yaml:
--------------------------------------------------------------------------------
1 | encryption_key: tlt_encode
2 | results_dir: "???"
3 | dataset:
4 | segment:
5 | dataset: "CNDataset" #TODO: remove if we only support this dataloader
6 | root_dir: "???"
7 | data_name: "LEVIR-CD" #LandSCD
8 | label_transform: "norm" #None for LandSCD - need to check
9 | batch_size: 4
10 | workers: 2
11 | num_classes: 2
12 | img_size: 256
13 | image_folder_name: "A"
14 | change_image_folder_name: 'B'
15 | list_folder_name: 'list'
16 | annotation_folder_name: "label"
17 | test_split: 'test'
18 | label_suffix: .png
19 | evaluate:
20 | trt_engine: "???"
21 | batch_size: 4
22 | model:
23 | backbone:
24 | type: "fan_small_12_p4_hybrid"
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/visual_changenet/specs/segment/gen_trt_engine.yaml:
--------------------------------------------------------------------------------
1 | encryption_key: tlt_encode
2 | results_dir: "???"
3 | dataset:
4 | segment:
5 | num_classes: 2
6 | batch_size: -1
7 | model:
8 | backbone:
9 | type: "fan_small_12_p4_hybrid"
10 | gen_trt_engine:
11 | gpu_id: 0
12 | onnx_file: "???"
13 | trt_engine: "???"
14 | batch_size: -1
15 | input_channel: 3
16 | input_width: 256
17 | input_height: 256
18 | tensorrt:
19 | data_type: FP32
20 | workspace_size: 1024
21 | min_batch_size: 1
22 | opt_batch_size: 10
23 | max_batch_size: 10
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/visual_changenet/specs/segment/infer.yaml:
--------------------------------------------------------------------------------
1 | encryption_key: tlt_encode
2 | results_dir: "???"
3 | dataset:
4 | segment:
5 | dataset: "CNDataset" #TODO: remove if we only support this dataloader
6 | root_dir: "???"
7 | data_name: "LEVIR-CD" #LandSCD
8 | label_transform: "norm" #None for LandSCD - need to check
9 | batch_size: 1
10 | workers: 2
11 | num_classes: 2
12 | img_size: 256
13 | image_folder_name: "A"
14 | change_image_folder_name: 'B'
15 | list_folder_name: 'list'
16 | annotation_folder_name: "label"
17 | predict_split: 'test'
18 | label_suffix: .png
19 | inference:
20 | trt_engine: "???"
21 | batch_size: 1
22 | model:
23 | backbone:
24 | type: "fan_small_12_p4_hybrid"
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/yolo_v3/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy YOLOv3."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/yolo_v3/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for yolo v3."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/yolo_v3/proto/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy YOLOv3 Proto."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/yolo_v3/proto/augmentation_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message AugmentationConfig {
6 | float hue = 1;
7 | float saturation = 2;
8 | float exposure = 3;
9 | float vertical_flip = 4;
10 | float horizontal_flip = 5;
11 | float jitter = 6;
12 | int32 output_width=7;
13 | int32 output_height=8;
14 | int32 output_channel=9;
15 | uint32 output_depth=12;
16 | int32 randomize_input_shape_period=10;
17 | map image_mean = 11;
18 | }
19 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/yolo_v3/proto/yolov3_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message YOLOv3Config {
6 | // optional
7 | string big_anchor_shape = 1;
8 | string mid_anchor_shape = 2;
9 | string small_anchor_shape = 3;
10 | float matching_neutral_box_iou = 4;
11 |
12 | // required
13 | string arch = 5;
14 | uint32 nlayers = 6;
15 | uint32 arch_conv_blocks = 7; // support [0, 1, 2]
16 |
17 | // required
18 | float loss_loc_weight = 8;
19 | float loss_neg_obj_weights = 9;
20 | float loss_class_weights = 10;
21 |
22 | repeated float freeze_blocks = 11;
23 | bool freeze_bn = 12;
24 |
25 | // force YOLO architecture to use ReLU instead of LeakyReLU
26 | bool force_relu = 13;
27 | }
28 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/yolo_v3/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy YOLOv3 scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/yolo_v4/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy YOLOv4."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/yolo_v4/entrypoint/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Entrypoint module for yolo v4."""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/yolo_v4/proto/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy YOLOv4 Proto."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/yolo_v4/proto/augmentation_config.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | syntax = "proto3";
4 |
5 | message AugmentationConfig {
6 | float hue = 1;
7 | float saturation = 2;
8 | float exposure = 3;
9 | float vertical_flip = 4;
10 | float horizontal_flip = 5;
11 | float jitter = 6;
12 | int32 output_width=7;
13 | int32 output_height=8;
14 | int32 output_channel=9;
15 | uint32 output_depth=14;
16 | int32 randomize_input_shape_period=10;
17 | float mosaic_prob=11;
18 | float mosaic_min_ratio=12;
19 | map image_mean = 13;
20 | }
21 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/cv/yolo_v4/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy YOLOv4 scripts module."""
16 |
17 | from __future__ import absolute_import
18 | from __future__ import division
19 | from __future__ import print_function
20 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/dataloader/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy DataLoader"""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/engine/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Engine"""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/inferencer/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Inferencer"""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/license/EULA.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NVIDIA/tao_deploy/21c66f2b294e837e39eaa574d1f1d72e977ffb21/nvidia_tao_deploy/license/EULA.pdf
--------------------------------------------------------------------------------
/nvidia_tao_deploy/license/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2017-2022, NVIDIA CORPORATION. All rights reserved.
2 |
3 | """EULA for TAO DEPLOY."""
4 |
5 | from __future__ import absolute_import
6 | from __future__ import division
7 | from __future__ import print_function
8 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/metrics/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy Metrics"""
16 |
--------------------------------------------------------------------------------
/nvidia_tao_deploy/utils/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy utils"""
16 |
--------------------------------------------------------------------------------
/release/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Module containing implementation of release packaging."""
16 |
--------------------------------------------------------------------------------
/release/docker/Dockerfile.l4t.release:
--------------------------------------------------------------------------------
1 | FROM nvcr.io/nvidia/tao/tao_toolkit:5.0.0-deploy-l4t-base
2 |
3 | # Installing the TAO Toolkit source code packages.
4 | WORKDIR /opt/nvidia
5 | COPY dist/*.whl /opt/nvidia/wheels/
6 | RUN python -m pip install pip --upgrade \
7 | && cd wheels && ls ./*.whl|xargs -I'{}' python -m pip install '{}' \
8 | && rm *.whl
9 |
10 | RUN rm -rf /opt/nvidia/entrypoint.d/*.txt
11 | COPY release/docker/entrypoint.d/* /opt/nvidia/entrypoint.d/
12 |
13 | # Fixes for 4.0.0 RC security scan
14 | RUN python -m pip uninstall graphviz -y
15 |
16 | ENV NVIDIA_PRODUCT_NAME "TAO Toolkit"
17 | ENV TAO_TOOLKIT_VERSION="5.2.0"
18 | ENV NVIDIA_TAO_TOOLKIT_VERSION="${TAO_TOOLKIT_VERSION}-Deploy"
19 | ENV TAO_TELEMETRY_SERVER="https://sqa-telemetry.metropolis.nvidia.com:443/api/v1/telemetry"
20 |
21 | CMD [ "/bin/bash" ]
22 |
--------------------------------------------------------------------------------
/release/docker/entrypoint.d/10-banner.txt:
--------------------------------------------------------------------------------
1 |
2 | =======================
3 | === TAO Toolkit Deploy ===
4 | =======================
5 |
--------------------------------------------------------------------------------
/release/docker/entrypoint.d/30-container-license.txt:
--------------------------------------------------------------------------------
1 |
2 | Various files include modifications (c) NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 |
4 | This container image and its contents are governed by the TAO Toolkit End User License Agreement.
5 | By pulling and using the container, you accept the terms and conditions of this license:
6 | https://developer.nvidia.com/tao-toolkit-software-license-agreement
7 |
--------------------------------------------------------------------------------
/release/docker/revert_obfuscation.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Description: Script responsible for reverting obfuscation.
3 |
4 | # Setting the repo root for local build environment or CI.
5 | [[ -z "${WORKSPACE}" ]] && REPO_ROOT='/workspace/tao-deploy' || REPO_ROOT="${WORKSPACE}"
6 |
7 | echo "Restoring the original project structure"
8 | # Move the obf_src files.
9 | rm -rf ${REPO_ROOT}/nvidia_tao_deploy/*
10 |
11 | # Move back the original files
12 | mv /orig_src/* ${REPO_ROOT}/nvidia_tao_deploy/
13 |
14 | # Remove the tmp folders.
15 | rm -rf /dist
16 | rm -rf /orig_src
17 | rm -rf /obf_src
18 | rm -rf ${REPO_ROOT}/pytransform_vax_001219
19 |
--------------------------------------------------------------------------------
/release/python/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Packaging modules for TAO Toolkit."""
--------------------------------------------------------------------------------
/release/python/utils/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """Module containing utility functions required for packaging TAO Toolkit modules."""
16 |
--------------------------------------------------------------------------------
/runner/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | """TAO Deploy runner"""
16 |
--------------------------------------------------------------------------------
/scripts/git-hooks/commit-msg.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | import sys
4 | import re
5 | from submodules.rules import rules
6 |
7 | def main():
8 | with open(sys.argv[1], "r") as fp:
9 | lines = fp.readlines()
10 |
11 | for idx, line in enumerate(lines):
12 |
13 | if line.strip() == "# ------------------------ >8 ------------------------":
14 | break
15 |
16 | if line[0] == "#":
17 | continue
18 |
19 | if not line_valid(idx, line):
20 | print(f"line# {idx} failed")
21 | show_rules()
22 | sys.exit(1)
23 |
24 | sys.exit(0)
25 |
26 | def line_valid(idx, line):
27 | if idx == 0:
28 | #return re.match("^[A-Z].{,48}[0-9A-z \t]$", line)
29 | return re.match("^\[((?!\s*$).{0,15})\][ \t].*?[A-Z].{0,48}[0-9A-z \t]$", line)
30 | else:
31 | return len(line.strip()) <= 72
32 |
33 | def show_rules():
34 | print(rules)
35 |
36 | if __name__ == "__main__":
37 | main()
--------------------------------------------------------------------------------
/scripts/git-hooks/install_hooks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | LIB_DIR=submodules
3 |
4 | rm -f .git/hooks/commit-msg
5 | ln -s -f $NV_TAO_BYOM_TOP/scripts/git-hooks/commit-msg.py .git/hooks/commit-msg
6 |
7 | rm -rf .git/hooks/${LIB_DIR}
8 | ln -s -f $NV_TAO_BYOM_TOP/scripts/git-hooks/${LIB_DIR} .git/hooks/${LIB_DIR}
--------------------------------------------------------------------------------
/scripts/git-hooks/submodules/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NVIDIA/tao_deploy/21c66f2b294e837e39eaa574d1f1d72e977ffb21/scripts/git-hooks/submodules/__init__.py
--------------------------------------------------------------------------------
/scripts/git-hooks/submodules/rules.py:
--------------------------------------------------------------------------------
1 | rules = """
2 | # Failing to add message in the mentioned format will
3 | # cause your local commit fail.
4 | #
5 | # Please follow these rules for commit messages:
6 | # ==============================================
7 | # 1. Commit message format - first line is mandatory
8 | # [YOUR_MODULE_NAME] Subject line here not exceeding 50 characters
9 | # * Optional line entry with detail not exceeding 72 characters
10 | # * Optional line entry with detail not exceeding 72 characters
11 | # * Optional line entry with detail not exceeding 72 characters
12 | # 2. Limit the module name (YOUR_MODULE_NAME) to 15 characters length
13 | # 3. Limit the subject(Text part after [YOUR_MODULE_NAME]) line to max
14 | # 50 characters
15 | # 4. Start subject (Text part after [YOUR_MODULE_NAME]) with a Capital
16 | # letter and don't end with a period '.'
17 | # 5. Wrap the body lines (if any) at 72 characters
18 | """
--------------------------------------------------------------------------------