diff --git a/tutorials/mct_model_garden/models_pytorch/yolox/darknet.py b/tutorials/mct_model_garden/models_pytorch/yolox/darknet.py index beac9bff8..083d49bcd 100644 --- a/tutorials/mct_model_garden/models_pytorch/yolox/darknet.py +++ b/tutorials/mct_model_garden/models_pytorch/yolox/darknet.py @@ -1,6 +1,19 @@ -# =========================================================================================== -# The following code was adopted from https://github.com/Megvii-BaseDetection/YOLOX -# =========================================================================================== +# ------------------------------------------------------------------------------ +# This file contains code from the https://github.com/Megvii-BaseDetection/YOLOX repository. +# Copyright (c) 2021-2022 Megvii Inc. All rights reserved. +# +# 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 from torch import nn diff --git a/tutorials/mct_model_garden/models_pytorch/yolox/yolox.py b/tutorials/mct_model_garden/models_pytorch/yolox/yolox.py index 00ba9d899..2bd9903ed 100644 --- a/tutorials/mct_model_garden/models_pytorch/yolox/yolox.py +++ b/tutorials/mct_model_garden/models_pytorch/yolox/yolox.py @@ -1,3 +1,19 @@ +# ------------------------------------------------------------------------------ +# This file contains code from the https://github.com/Megvii-BaseDetection/YOLOX repository. +# Copyright (c) 2021-2022 Megvii Inc. All rights reserved. +# +# 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. +# ------------------------------------------------------------------------------ + # The following code was mostly duplicated from https://github.com/Megvii-BaseDetection/YOLOX # and changed to generate an equivalent PyTorch model suitable for quantization. # Main changes: diff --git a/tutorials/mct_model_garden/models_pytorch/yolox/yolox.yaml b/tutorials/mct_model_garden/models_pytorch/yolox/yolox.yaml index f3dd4508f..b20cba9cb 100644 --- a/tutorials/mct_model_garden/models_pytorch/yolox/yolox.yaml +++ b/tutorials/mct_model_garden/models_pytorch/yolox/yolox.yaml @@ -1,3 +1,18 @@ +# Copyright 2024 Sony Semiconductor Israel, Inc. All rights reserved. +# +# 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. +# ============================================================================== + nano: depth: 0.33 width: 0.25 diff --git a/tutorials/mct_model_garden/models_pytorch/yolox/yolox_preprocess.py b/tutorials/mct_model_garden/models_pytorch/yolox/yolox_preprocess.py index 7f21a894e..279abff0f 100644 --- a/tutorials/mct_model_garden/models_pytorch/yolox/yolox_preprocess.py +++ b/tutorials/mct_model_garden/models_pytorch/yolox/yolox_preprocess.py @@ -1,17 +1,6 @@ -# Copyright 2024 Sony Semiconductor Israel, Inc. All rights reserved. -# -# 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. -# ============================================================================== +# =========================================================================================== +# The following code was adopted from https://github.com/Megvii-BaseDetection/YOLOX +# =========================================================================================== import numpy as np from typing import Tuple diff --git a/tutorials/notebooks/imx500_notebooks/pytorch/pytorch_yolox-tiny_for_imx500.ipynb b/tutorials/notebooks/imx500_notebooks/pytorch/pytorch_yolox-tiny_for_imx500.ipynb index b4b4d43fc..3781fdcbe 100644 --- a/tutorials/notebooks/imx500_notebooks/pytorch/pytorch_yolox-tiny_for_imx500.ipynb +++ b/tutorials/notebooks/imx500_notebooks/pytorch/pytorch_yolox-tiny_for_imx500.ipynb @@ -15,7 +15,7 @@ "\n", "In this tutorial, we will illustrate a basic and quick process of preparing a pre-trained model for deployment using MCT. Specifically, we will demonstrate how to download a pre-trained pytorch YOLOX-Tiny model, compress it, and make it deployment-ready using MCT's post-training quantization techniques.\n", "\n", - "We will use an existing pre-trained YOLOX-Tiny model based on [YOLOX](https://github.com/Megvii-BaseDetection/YOLOX). The model was slightly adjusted for model quantization. We will quantize the model using MCT post training quantization technique and evaluate the performance of the floating point model and the quantized model on COCO dataset.\n", + "We will use an existing pre-trained YOLOX-Tiny model based on [YOLOX](https://github.com/Megvii-BaseDetection/YOLOX) and integrate Box decoding and NMS to the model. The model was slightly adjusted for model quantization. We will quantize the model using MCT post training quantization technique and evaluate the performance of the floating point model and the quantized model on COCO dataset.\n", "\n", "\n", "## Summary\n", @@ -48,7 +48,7 @@ "!pip install -q torch\n", "!pip install onnx\n", "!pip install -q pycocotools\n", - "!pip install --pre 'sony-custom-layers-dev>=0.2.0.dev5'\n", + "!pip install 'sony-custom-layers'\n", "# TODO change to !pip install 'sony-custom-layers' when new release\n" ], "outputs": [],