New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Tutorials] Anomaly Detection example MVTec PatchSVDD #203
Conversation
Jenkins please retry a build |
Jenkins please retry a build |
a9d14c5
to
8e27dd8
Compare
Jenkins please retry a build |
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/envoy/mvtec_shard_descriptor.py
Outdated
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/envoy/mvtec_shard_descriptor.py
Outdated
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/envoy/mvtec_shard_descriptor.py
Outdated
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/envoy/mvtec_shard_descriptor.py
Outdated
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/envoy/mvtec_shard_descriptor.py
Outdated
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/envoy/mvtec_shard_descriptor.py
Outdated
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/envoy/mvtec_shard_descriptor.py
Outdated
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/envoy/mvtec_shard_descriptor.py
Outdated
Show resolved
Hide resolved
...fl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/workspace/PatchSVDD_with_Director.ipynb
Outdated
Show resolved
Hide resolved
Jenkins please retry a build |
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/README.md
Outdated
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/envoy/mvtec_shard_descriptor.py
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/envoy/mvtec_shard_descriptor.py
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/envoy/mvtec_shard_descriptor.py
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/workspace/data_transf.py
Outdated
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/envoy/mvtec_shard_descriptor.py
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/envoy/shard_config.yaml
Outdated
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/envoy/mvtec_shard_descriptor.py
Show resolved
Hide resolved
...fl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/workspace/PatchSVDD_with_Director.ipynb
Outdated
Show resolved
Hide resolved
" device='device', optimizer='optimizer') \n", | ||
"\n", | ||
"def train(model, train_loader, optimizer, device, some_parameter=None):\n", | ||
" if not torch.cuda.is_available():\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example doesn't work if the director and the workspace are located on different services or in different virtual environments, because serialisable objects use requirements (torch, ngtpy, at least) that are missing on the director.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aleksandr-mokrov how should I ensure this?
#206 was merged into develop. Can you rewrite ShardDescriptor using new ShardDescriptor and ShardDataset (https://github.com/intel/openfl/blob/develop/openfl/interface/interactive_api/shard_descriptor.py) like in other tutorials: https://github.com/intel/openfl/blob/develop/openfl-tutorials/interactive_api/PyTorch_Kvasir_UNet, https://github.com/intel/openfl/tree/develop/openfl-tutorials/interactive_api/PyTorch_Market_Re-ID, https://github.com/intel/openfl/tree/develop/openfl-tutorials/interactive_api/PyTorch_TinyImageNet, https://github.com/intel/openfl/tree/develop/openfl-tutorials/interactive_api/Tensorflow_MNIST? |
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/README.md
Outdated
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/README.md
Outdated
Show resolved
Hide resolved
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/README.md
Outdated
Show resolved
Hide resolved
...fl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/workspace/PatchSVDD_with_Director.ipynb
Outdated
Show resolved
Hide resolved
@mansishr Can we rebase this branch and get all latest develop updates into it |
74e824f
to
50f1c64
Compare
...fl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/workspace/PatchSVDD_with_Director.ipynb
Show resolved
Hide resolved
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"fed_dataset = MVTecSD(train_bs=64, val_bs=64)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cell producing a bunch of output inside Jupyter notebook, could we avoid this?
@mansishr I was able to run the example with director, 1 envoy and API layer on 3 different machines. However, the code of the notebook must be simplified a lot. |
Also, MVTec dataset once it downloaded has some troubles with permission right. I run an envoy, and after I stopped it, I couldn't remove the data which this envoy downloaded, which would be confusing for end users. |
* Fix envoy config in Histology tutorial * Fix listen_host setting in director config
* Set values to default and additional checks if they are unfilled * flake8 * flake8 * Handle exception from get_cuda_version * Handle exception from get_cuda_version * Reduce line's length
* update tutorials configs * Update start_envoy.sh * return listen_host variable back * make .sh files executable Co-authored-by: katerina-merkulova <ekaterina1.merkulova@intel.com> Co-authored-by: Ekaterina Merkulova <87072230+katerina-merkulova@users.noreply.github.com>
@mansishr I am closing this due to unnecessary artefacts after rebase, please create a new branch from fresh |
In this PR, the problem of image anomaly detection and segmentation is addressed. Anomaly detection involves making a binary decision as to whether an input image contains an anomaly, and anomaly segmentation aims to locate the anomaly on the pixel level. The deep learning variant of support vector data description (SVDD) algorithm is extended to the patch-based method using self-supervised learning. This extension enables anomaly segmentation and improves detection performance. Industrial dataset is used for this tutorial - MVTec AD dataset.