Skip to content

Commit

Permalink
replace np.str with str
Browse files Browse the repository at this point in the history
Summary:
`np.str` is removed from numpy 1.20.0. It was an alias to builtin `str` and it's safe to do the replacement.

The whole changes is mechanical, generated using the following onliner:
```
fbgr -sl 'np\.str\b' | xargs perl -pi -e 's,\bnp\.str\b,str,g'
```

Differential Revision: D46586144

fbshipit-source-id: 4dd09345409294e1ba6db48f2201a074a2ae5c05
  • Loading branch information
igorsugak authored and facebook-github-bot committed Jun 13, 2023
1 parent 54dd614 commit 654570a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion detectron2/data/datasets/pascal_voc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def load_voc_instances(dirname: str, split: str, class_names: Union[List[str], T
class_names: list or tuple of class names
"""
with PathManager.open(os.path.join(dirname, "ImageSets", "Main", split + ".txt")) as f:
fileids = np.loadtxt(f, dtype=np.str)
fileids = np.loadtxt(f, dtype=str)

# Needs to read many small annotation files. Makes sense at local
annotation_dirname = PathManager.get_local_path(os.path.join(dirname, "Annotations/"))
Expand Down

0 comments on commit 654570a

Please sign in to comment.