Skip to content

Commit

Permalink
Add third-party-programs.txt file and update license (#132)
Browse files Browse the repository at this point in the history
* Add third-party-programs.txt file and update license

* Fix precommit warnings

* Update third-party-programs.txt

* Update README.md

Co-authored-by: Samet Akcay <samet.akcay@intel.com>
  • Loading branch information
LeonidBeynenson and samet-akcay committed Mar 5, 2022
1 parent 20cbffa commit aa49b7d
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ You can get started with `anomalib` by just using pip.
pip install anomalib
```

> **_NOTE:_** Due to ongoing face pace of development, we encourage you to use editable install until we release v0.2.5.
> **_NOTE:_** Due to ongoing fast pace of development, we encourage you to use editable install until we release v0.2.5.
### Local Install
It is highly recommended to use virtual environment when installing anomalib. For instance, with [anaconda](https://www.anaconda.com/products/individual), `anomalib` could be installed as,
Expand Down
21 changes: 7 additions & 14 deletions anomalib/models/ganomaly/torch_model.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
# Copyright (c) 2018-2022 Samet Akcay, Durham University, UK
# SPDX-License-Identifier: MIT
#
# Copyright (C) 2020-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#

"""Torch models defining encoder, decoder, Generator and Discriminator.
Code adapted from https://github.com/samet-akcay/ganomaly.
"""

# Copyright (C) 2020 Intel Corporation
#
# 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 math

Expand Down
1 change: 1 addition & 0 deletions anomalib/utils/callbacks/nncf_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def __init__(self, config: Union[ListConfig, DictConfig], dirpath: str, filename
self.compression_scheduler: CompressionScheduler

def setup(self, trainer: pl.Trainer, pl_module: pl.LightningModule, stage: Optional[str] = None) -> None:
# pylint: disable=unused-argument
"""Call when fit or test begins.
Takes the pytorch model and wraps it using the compression controller so that it is ready for nncf fine-tuning.
Expand Down
12 changes: 9 additions & 3 deletions tests/nightly/models/test_model_nightly.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from datetime import datetime
from pathlib import Path
from typing import Dict, List, Union

import numpy as np
import pandas as pd
import torch
Expand Down Expand Up @@ -89,13 +90,19 @@ def _test_metrics(self, trainer, config, model, datamodule):
threshold = thresholds[config.model.name][config.dataset.category]
if "optimization" in config.keys() and config.optimization.nncf.apply:
threshold = threshold.nncf
if not (np.isclose(results["image_AUROC"], threshold["image_AUROC"], rtol=0.02) or (results["image_AUROC"] >= threshold["image_AUROC"])):
if not (
np.isclose(results["image_AUROC"], threshold["image_AUROC"], rtol=0.02)
or (results["image_AUROC"] >= threshold["image_AUROC"])
):
raise AssertionError(
f"results['image_AUROC']:{results['image_AUROC']} >= threshold['image_AUROC']:{threshold['image_AUROC']}"
)

if config.dataset.task == "segmentation":
if not (np.isclose(results["pixel_AUROC"] ,threshold["pixel_AUROC"], rtol=0.02) or (results["pixel_AUROC"] >= threshold["pixel_AUROC"])):
if not (
np.isclose(results["pixel_AUROC"], threshold["pixel_AUROC"], rtol=0.02)
or (results["pixel_AUROC"] >= threshold["pixel_AUROC"])
):
raise AssertionError(
f"results['pixel_AUROC']:{results['pixel_AUROC']} >= threshold['pixel_AUROC']:{threshold['pixel_AUROC']}"
)
Expand Down Expand Up @@ -174,4 +181,3 @@ def test_model(self, path=get_dataset_path(), score_type=None):
job.result()
except Exception as e:
raise e

20 changes: 20 additions & 0 deletions third-party-programs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Third Party Programs File

This file contains the list of third party software ("third party programs")
contained in the Intel software and their required notices and/or license
terms. This third party software, even if included with the distribution of
the Intel software, may be governed by separate license terms, including
without limitation, third party license terms, other Intel software license
terms, and open source software license terms. These separate license terms
govern your use of the third party programs as set forth in the
"third-party-programs.txt" or other similarly-named text file.

Third party programs and their corresponding required notices and/or license
terms are listed below.

-------------------------------------------------------------

1. Encoder, Decoder, Discriminator, Generator
Copyright (c) 2018-2022 Samet Akcay, Durham University, UK
SPDX-License-Identifier: MIT
2 changes: 1 addition & 1 deletion tools/benchmarking/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def sweep(run_config: Union[DictConfig, ListConfig], device: int = 0, seed: int
# Benchmarking entry point.
# Spawn multiple processes one for cpu and rest for the number of gpus available in the system.
# The idea is to distribute metrics collection over all the available devices.

print("Benchmarking started 🏃‍♂️. This will take a while ⏲ depending on your configuration.")
distribute()
print("Finished gathering results ⚡")

0 comments on commit aa49b7d

Please sign in to comment.