Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[mxnet 2.0] deprecate gluon.model_zoo, image.detection #18480

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions python/mxnet/gluon/model_zoo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@

# coding: utf-8
"""Predefined and pretrained models."""
import warnings

# 2020-06-02, mxnet 2.0.0
warnings.warn(("gluon.model_zoo has been deprecated and will be removed from a future release. "
"Please use install `gluoncv` or `gluonnlp` to retrieve the managed models "
"For example, you can replace existing code with "
"`gluoncv.model_zoo.get_model('resnet18_v1', pretrained=True)`."),
DeprecationWarning, stacklevel=2)

from . import model_store

Expand Down
11 changes: 8 additions & 3 deletions python/mxnet/image/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,20 @@

# pylint: disable=unused-import, too-many-lines
"""Read images and perform augmentations for object detection."""


import json
import logging
import random
import warnings

import numpy as np

# 2020-06-02, mxnet 2.0.0
warnings.warn(("mxnet.image.detection.* functions has been deprecated "
"and will be removed from a future release. "
"Please use gluon transform functions instead. "
"For example, you can replace `ImageDetIter` with "
"`gluon.contrib.data.vision.ImageBboxDataLoader`."),
DeprecationWarning, stacklevel=2)

from ..base import numeric_types
from .. import ndarray as nd
from ..ndarray._internal import _cvcopyMakeBorder as copyMakeBorder
Expand Down
5 changes: 5 additions & 0 deletions python/mxnet/image/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,11 @@ def __init__(self, batch_size, data_shape, label_width=1,
shuffle=False, part_index=0, num_parts=1, aug_list=None, imglist=None,
data_name='data', label_name='softmax_label', dtype='float32',
last_batch_handle='pad', **kwargs):
# 2020-06-02, mxnet 2.0.0
warnings.warn(("mxnet.image.ImageIter has been deprecated "
"and will be removed from a future release. "
"Please use `gluon.contrib.data.vision.ImageDataLoader` instead. "),
DeprecationWarning, stacklevel=2)
super(ImageIter, self).__init__()
assert path_imgrec or path_imglist or (isinstance(imglist, list))
assert dtype in ['int32', 'float32', 'int64', 'float64'], dtype + ' label not supported'
Expand Down