From c0ff67ba3baf807107447cc54d5f997cb358a383 Mon Sep 17 00:00:00 2001 From: osimeoni <oriane.simeoni@gmail.com> Date: Mon, 30 May 2022 17:23:50 +0200 Subject: [PATCH] Update: headers --- cluster_for_OD.py | 14 ++++++++++++++ datasets.py | 14 ++++++++++++++ main_corloc_evaluation.py | 14 ++++++++++++++ main_lost.py | 14 ++++++++++++++ networks.py | 14 ++++++++++++++ object_discovery.py | 15 +++++++++++++++ ...OST_CAD_pseudo_boxes_in_detectron2_format.py | 14 ++++++++++++++ ...LOST_OD_pseudo_boxes_in_detectron2_format.py | 14 ++++++++++++++ tools/prepare_voc_data_in_coco_style.py | 14 ++++++++++++++ tools/train_net_for_LOST_CAD.py | 17 ++--------------- tools/train_net_for_LOST_OD.py | 17 ++--------------- visualizations.py | 14 ++++++++++++++ 12 files changed, 145 insertions(+), 30 deletions(-) diff --git a/cluster_for_OD.py b/cluster_for_OD.py index d4a05ad..9212f5f 100755 --- a/cluster_for_OD.py +++ b/cluster_for_OD.py @@ -1,3 +1,17 @@ +# Copyright 2021 - Valeo Comfort and Driving Assistance - Oriane Siméoni @ valeo.ai +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os import argparse import pickle diff --git a/datasets.py b/datasets.py index 678ec7a..35646ac 100755 --- a/datasets.py +++ b/datasets.py @@ -1,3 +1,17 @@ +# Copyright 2021 - Valeo Comfort and Driving Assistance - Oriane Siméoni @ valeo.ai +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os import torch import json diff --git a/main_corloc_evaluation.py b/main_corloc_evaluation.py index a4d9fb4..9cf4537 100755 --- a/main_corloc_evaluation.py +++ b/main_corloc_evaluation.py @@ -1,3 +1,17 @@ +# Copyright 2021 - Valeo Comfort and Driving Assistance - Oriane Siméoni @ valeo.ai +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os import cv2 import pdb diff --git a/main_lost.py b/main_lost.py index 15ae34c..c4f2938 100755 --- a/main_lost.py +++ b/main_lost.py @@ -1,3 +1,17 @@ +# Copyright 2021 - Valeo Comfort and Driving Assistance - Oriane Siméoni @ valeo.ai +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os import argparse import random diff --git a/networks.py b/networks.py index 40441bf..e5af429 100755 --- a/networks.py +++ b/networks.py @@ -1,3 +1,17 @@ +# Copyright 2021 - Valeo Comfort and Driving Assistance - Oriane Siméoni @ valeo.ai +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import torch import torch.nn as nn diff --git a/object_discovery.py b/object_discovery.py index a52c0e4..42da074 100644 --- a/object_discovery.py +++ b/object_discovery.py @@ -1,3 +1,17 @@ +# Copyright 2021 - Valeo Comfort and Driving Assistance - Oriane Siméoni @ valeo.ai +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import torch import scipy import scipy.ndimage @@ -109,6 +123,7 @@ def detect_box(A, seed, dims, initial_im_size=None, scales=None): def dino_seg(attn, dims, patch_size, head=0): """ Extraction of boxes based on the DINO segmentation method proposed in https://github.com/facebookresearch/dino. + Modified from https://github.com/facebookresearch/dino/blob/main/visualize_attention.py """ w_featmap, h_featmap = dims nh = attn.shape[1] diff --git a/tools/prepare_voc_LOST_CAD_pseudo_boxes_in_detectron2_format.py b/tools/prepare_voc_LOST_CAD_pseudo_boxes_in_detectron2_format.py index 22b528a..1fbba66 100755 --- a/tools/prepare_voc_LOST_CAD_pseudo_boxes_in_detectron2_format.py +++ b/tools/prepare_voc_LOST_CAD_pseudo_boxes_in_detectron2_format.py @@ -1,3 +1,17 @@ +# Copyright 2021 - Valeo Comfort and Driving Assistance +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import argparse import os import pdb diff --git a/tools/prepare_voc_LOST_OD_pseudo_boxes_in_detectron2_format.py b/tools/prepare_voc_LOST_OD_pseudo_boxes_in_detectron2_format.py index cc065b7..78036bd 100755 --- a/tools/prepare_voc_LOST_OD_pseudo_boxes_in_detectron2_format.py +++ b/tools/prepare_voc_LOST_OD_pseudo_boxes_in_detectron2_format.py @@ -1,3 +1,17 @@ +# Copyright 2021 - Valeo Comfort and Driving Assistance +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import argparse import os import xml.etree.ElementTree as ET diff --git a/tools/prepare_voc_data_in_coco_style.py b/tools/prepare_voc_data_in_coco_style.py index 3ccec41..5d2743b 100755 --- a/tools/prepare_voc_data_in_coco_style.py +++ b/tools/prepare_voc_data_in_coco_style.py @@ -1,3 +1,17 @@ +# Copyright 2021 - Valeo Comfort and Driving Assistance +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import argparse import os from os.path import join diff --git a/tools/train_net_for_LOST_CAD.py b/tools/train_net_for_LOST_CAD.py index 7717798..bbac8cf 100755 --- a/tools/train_net_for_LOST_CAD.py +++ b/tools/train_net_for_LOST_CAD.py @@ -1,20 +1,7 @@ #!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. -""" -Detection Training Script. - -This scripts reads a given config file and runs the training or evaluation. -It is an entry point that is made to train standard models in detectron2. - -In order to let one script support training of many models, -this script contains logic that are specific to these built-in models and therefore -may not be suitable for your own project. -For example, your research project perhaps only needs a single "evaluator". - -Therefore, we recommend you to use detectron2 as an library and take -this file as an example of how to use the library. -You may want to write your own script with your datasets and other customizations. -""" +# Copyright 2021 Valeo Comfort and Driving Assistance. All rights reserved. +# Adapted from detectron2. import logging import os diff --git a/tools/train_net_for_LOST_OD.py b/tools/train_net_for_LOST_OD.py index 3c46d20..d786509 100755 --- a/tools/train_net_for_LOST_OD.py +++ b/tools/train_net_for_LOST_OD.py @@ -1,20 +1,7 @@ #!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. -""" -Detection Training Script. - -This scripts reads a given config file and runs the training or evaluation. -It is an entry point that is made to train standard models in detectron2. - -In order to let one script support training of many models, -this script contains logic that are specific to these built-in models and therefore -may not be suitable for your own project. -For example, your research project perhaps only needs a single "evaluator". - -Therefore, we recommend you to use detectron2 as an library and take -this file as an example of how to use the library. -You may want to write your own script with your datasets and other customizations. -""" +# Copyright 2021 Valeo Comfort and Driving Assistance. All rights reserved. +# Adapted from detectron2. import logging import os diff --git a/visualizations.py b/visualizations.py index 5ee43d0..867b311 100755 --- a/visualizations.py +++ b/visualizations.py @@ -1,3 +1,17 @@ +# Copyright 2021 - Valeo Comfort and Driving Assistance - Oriane Siméoni @ valeo.ai +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import cv2 import torch import skimage.io -- GitLab