Skip to content

Commit 7a2bf29

Browse files
authored
add support for fiftyone > 0.14.2 (#296)
* add support for fiftyone > 0.14.2 * update to v0.8.13 * handle when coco image names inclue folder
1 parent e002f1d commit 7a2bf29

File tree

3 files changed

+5
-72
lines changed

3 files changed

+5
-72
lines changed

README.md

+3-10
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ sahi predict --slice_width 256 --slice_height 256 --overlap_height_ratio 0.1 --o
195195
<big><b>Explore COCO dataset via FiftyOne app:</b></big>
196196
</summary>
197197

198-
For supported version: `pip install fiftyone>=0.11.1<0.15.0`
198+
For supported version: `pip install fiftyone>=0.14.2<0.15.0`
199199

200200
```python
201201
from sahi.utils.fiftyone import launch_fiftyone_app
@@ -437,15 +437,8 @@ If you use this package in your work, please cite it as:
437437

438438
```
439439
@software{akyon2021sahi,
440-
author = {Akyon, Fatih Cagatay and
441-
Cengiz, Cemil and
442-
Altinuc, Sinan Onur and
443-
Cavusoglu, Devrim and
444-
Sahin, Kadir and
445-
Eryuksel, Ogulcan},
446-
title = {{SAHI: A lightweight vision library for performing
447-
large scale object detection and instance
448-
segmentation}},
440+
author = {Akyon, Fatih Cagatay and Cengiz, Cemil and Altinuc, Sinan Onur and Cavusoglu, Devrim and Sahin, Kadir and Eryuksel, Ogulcan},
441+
title = {{SAHI: A lightweight vision library for performing large scale object detection and instance segmentation}},
449442
month = nov,
450443
year = 2021,
451444
publisher = {Zenodo},

sahi/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.8.12"
1+
__version__ = "0.8.13"

sahi/utils/fiftyone.py

+1-61
Original file line numberDiff line numberDiff line change
@@ -3,72 +3,12 @@
33
try:
44
import fiftyone as fo
55
from fiftyone.utils.coco import COCODetectionDatasetImporter as BaseCOCODetectionDatasetImporter
6-
from fiftyone.utils.coco import _get_matching_image_ids, _parse_label_types, load_coco_detection_annotations
6+
from fiftyone.utils.coco import _get_matching_image_ids, load_coco_detection_annotations
77
except ModuleNotFoundError:
88
raise ModuleNotFoundError('Please run "pip install -U fiftyone" to install fiftyone first for fiftyone utilities.')
99

1010

1111
class COCODetectionDatasetImporter(BaseCOCODetectionDatasetImporter):
12-
def __init__(
13-
self,
14-
dataset_dir=None,
15-
data_path=None,
16-
labels_path=None,
17-
label_types=None,
18-
classes=None,
19-
image_ids=None,
20-
include_id=False,
21-
extra_attrs=None,
22-
only_matching=False,
23-
use_polylines=False,
24-
tolerance=None,
25-
shuffle=False,
26-
seed=None,
27-
max_samples=None,
28-
):
29-
data_path = self._parse_data_path(
30-
dataset_dir=dataset_dir,
31-
data_path=data_path,
32-
default="data/",
33-
)
34-
35-
labels_path = self._parse_labels_path(
36-
dataset_dir=dataset_dir,
37-
labels_path=labels_path,
38-
default="labels.json",
39-
)
40-
41-
label_types = _parse_label_types(label_types)
42-
43-
if include_id:
44-
label_types.append("coco_id")
45-
46-
super().__init__(
47-
dataset_dir=dataset_dir,
48-
shuffle=shuffle,
49-
seed=seed,
50-
max_samples=max_samples,
51-
)
52-
53-
self.data_path = data_path
54-
self.labels_path = labels_path
55-
self.label_types = label_types
56-
self.classes = classes
57-
self.image_ids = image_ids
58-
self.extra_attrs = extra_attrs
59-
self.only_matching = only_matching
60-
self.use_polylines = use_polylines
61-
self.tolerance = tolerance
62-
63-
self._info = None
64-
self._classes = None
65-
self._supercategory_map = None
66-
self._image_paths_map = None
67-
self._image_dicts_map = None
68-
self._annotations = None
69-
self._filenames = None
70-
self._iter_filenames = None
71-
7212
def setup(self):
7313
if self.labels_path is not None and os.path.isfile(self.labels_path):
7414
(

0 commit comments

Comments
 (0)