|
| 1 | +"""Enable fastseg models to appear in the OMZ table |
| 2 | +
|
| 3 | +Revision ID: 9ede8e012999 |
| 4 | +Revises: c2f12b313b48 |
| 5 | +Create Date: 2022-02-11 15:23:34.127963 |
| 6 | +
|
| 7 | +""" |
| 8 | + |
| 9 | +""" |
| 10 | + OpenVINO DL Workbench |
| 11 | + Migration: Enable fastseg models to appear in the OMZ table |
| 12 | +
|
| 13 | + Copyright (c) 2022 Intel Corporation |
| 14 | +
|
| 15 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 16 | + you may not use this file except in compliance with the License. |
| 17 | + You may obtain a copy of the License at |
| 18 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 19 | + Unless required by applicable law or agreed to in writing, software |
| 20 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 21 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 22 | + See the License for the specific language governing permissions and |
| 23 | + limitations under the License. |
| 24 | +""" |
| 25 | + |
| 26 | +from alembic import op |
| 27 | +import sqlalchemy as sa |
| 28 | + |
| 29 | + |
| 30 | +# revision identifiers, used by Alembic. |
| 31 | +revision = '9ede8e012999' |
| 32 | +down_revision = 'c2f12b313b48' |
| 33 | +branch_labels = None |
| 34 | +depends_on = None |
| 35 | + |
| 36 | + |
| 37 | +def upgrade(): |
| 38 | + |
| 39 | + op.execute( |
| 40 | + 'UPDATE omz_topologies SET advanced_configuration = \'{"preprocessing": [{"type": "auto_resize"}], "postprocessing": [{"type": "encode_segmentation_mask", "apply_to": "annotation"}, {"type": "resize_segmentation_mask", "apply_to": "prediction"}], "metric": [{"type": "mean_iou", "use_argmax": false, "presenter": "print_scalar", "reference": 0.7267}], "annotationConversion": {}, "adapterConfiguration": {"adapter": {"type": "segmentation", "make_argmax": true}}}\' WHERE name = \'fastseg-large\';') |
| 41 | + op.execute( |
| 42 | + 'UPDATE omz_topologies SET advanced_configuration = \'{"preprocessing": [{"type": "auto_resize"}], "postprocessing": [{"type": "encode_segmentation_mask", "apply_to": "annotation"}, {"type": "resize_segmentation_mask", "apply_to": "prediction"}], "metric": [{"type": "mean_iou", "use_argmax": false, "presenter": "print_scalar", "reference": 0.6715}], "annotationConversion": {}, "adapterConfiguration": {"adapter": {"type": "segmentation", "make_argmax": true}}}\' WHERE name = \'fastseg-small\';') |
| 43 | + |
| 44 | + |
| 45 | +def downgrade(): |
| 46 | + raise NotImplementedError(f'Downgrade is not implemented for the {revision} migration') |
| 47 | + |
0 commit comments