refactor: all data
Browse files- Class_Segmentation/12.png +0 -3
- Class_Segmentation/13.png +0 -3
- Class_Segmentation/2.png +0 -3
- Class_Segmentation/3.png +0 -3
- Class_Segmentation/4.png +0 -3
- Class_Segmentation/5.png +0 -3
- Class_Segmentation/6.png +0 -3
- Class_Segmentation/7.png +0 -3
- Class_Segmentation/8.png +0 -3
- Class_Segmentation/9.png +0 -3
- Object_Segmentation/1.png +0 -3
- Object_Segmentation/10.png +0 -3
- Object_Segmentation/11.png +0 -3
- Object_Segmentation/12.png +0 -3
- Object_Segmentation/13.png +0 -3
- Object_Segmentation/2.png +0 -3
- Object_Segmentation/3.png +0 -3
- Object_Segmentation/4.png +0 -3
- Object_Segmentation/5.png +0 -3
- Object_Segmentation/6.png +0 -3
- Object_Segmentation/7.png +0 -3
- Object_Segmentation/8.png +0 -3
- Object_Segmentation/9.png +0 -3
- Plantations_Segmentation/annotations.xml +0 -0
- Plantations_Segmentation/img/1.png +0 -3
- Plantations_Segmentation/img/10.jpeg +0 -3
- Plantations_Segmentation/img/11.png +0 -3
- Plantations_Segmentation/img/12.png +0 -3
- Plantations_Segmentation/img/13.jpg +0 -3
- Plantations_Segmentation/img/2.jpg +0 -3
- Plantations_Segmentation/img/3.jpeg +0 -3
- Plantations_Segmentation/img/4.jpg +0 -3
- Plantations_Segmentation/img/5.png +0 -3
- Plantations_Segmentation/img/6.png +0 -3
- Plantations_Segmentation/img/7.png +0 -3
- Plantations_Segmentation/img/8.png +0 -3
- Plantations_Segmentation/img/9.jpg +0 -3
- Class_Segmentation/1.png → data/class_segmentation.tar.gz +2 -2
- Class_Segmentation/11.png → data/images.tar.gz +2 -2
- Class_Segmentation/10.png → data/object_segmentation.tar.gz +2 -2
- data/plantations_segmentation.csv +0 -0
- plantations.csv +0 -14
- plantations_segmentation.py +100 -0
Class_Segmentation/12.png
DELETED
Git LFS Details
|
Class_Segmentation/13.png
DELETED
Git LFS Details
|
Class_Segmentation/2.png
DELETED
Git LFS Details
|
Class_Segmentation/3.png
DELETED
Git LFS Details
|
Class_Segmentation/4.png
DELETED
Git LFS Details
|
Class_Segmentation/5.png
DELETED
Git LFS Details
|
Class_Segmentation/6.png
DELETED
Git LFS Details
|
Class_Segmentation/7.png
DELETED
Git LFS Details
|
Class_Segmentation/8.png
DELETED
Git LFS Details
|
Class_Segmentation/9.png
DELETED
Git LFS Details
|
Object_Segmentation/1.png
DELETED
Git LFS Details
|
Object_Segmentation/10.png
DELETED
Git LFS Details
|
Object_Segmentation/11.png
DELETED
Git LFS Details
|
Object_Segmentation/12.png
DELETED
Git LFS Details
|
Object_Segmentation/13.png
DELETED
Git LFS Details
|
Object_Segmentation/2.png
DELETED
Git LFS Details
|
Object_Segmentation/3.png
DELETED
Git LFS Details
|
Object_Segmentation/4.png
DELETED
Git LFS Details
|
Object_Segmentation/5.png
DELETED
Git LFS Details
|
Object_Segmentation/6.png
DELETED
Git LFS Details
|
Object_Segmentation/7.png
DELETED
Git LFS Details
|
Object_Segmentation/8.png
DELETED
Git LFS Details
|
Object_Segmentation/9.png
DELETED
Git LFS Details
|
Plantations_Segmentation/annotations.xml
DELETED
The diff for this file is too large to render.
See raw diff
|
|
Plantations_Segmentation/img/1.png
DELETED
Git LFS Details
|
Plantations_Segmentation/img/10.jpeg
DELETED
Git LFS Details
|
Plantations_Segmentation/img/11.png
DELETED
Git LFS Details
|
Plantations_Segmentation/img/12.png
DELETED
Git LFS Details
|
Plantations_Segmentation/img/13.jpg
DELETED
Git LFS Details
|
Plantations_Segmentation/img/2.jpg
DELETED
Git LFS Details
|
Plantations_Segmentation/img/3.jpeg
DELETED
Git LFS Details
|
Plantations_Segmentation/img/4.jpg
DELETED
Git LFS Details
|
Plantations_Segmentation/img/5.png
DELETED
Git LFS Details
|
Plantations_Segmentation/img/6.png
DELETED
Git LFS Details
|
Plantations_Segmentation/img/7.png
DELETED
Git LFS Details
|
Plantations_Segmentation/img/8.png
DELETED
Git LFS Details
|
Plantations_Segmentation/img/9.jpg
DELETED
Git LFS Details
|
Class_Segmentation/1.png → data/class_segmentation.tar.gz
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b6b859b5af1153513b186bfd3b533a4600d1c5c463a712c1b9c089b7cf0b2205
|
3 |
+
size 455833
|
Class_Segmentation/11.png → data/images.tar.gz
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9b8d7facc832a219a6ed0e21f3f192bcac28af8e875eefbb4734e390f751a0dd
|
3 |
+
size 46809599
|
Class_Segmentation/10.png → data/object_segmentation.tar.gz
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bc52606bb631f2e48eab104ebb87dd14a95ebdf2ecd1340d61cc43de9be0580e
|
3 |
+
size 510121
|
data/plantations_segmentation.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
plantations.csv
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
image_id;image_name
|
2 |
-
1;Plantations_Segmentation/img/1.png
|
3 |
-
2;Plantations_Segmentation/img/2.png
|
4 |
-
3;Plantations_Segmentation/img/3.png
|
5 |
-
4;Plantations_Segmentation/img/4.png
|
6 |
-
5;Plantations_Segmentation/img/5.png
|
7 |
-
6;Plantations_Segmentation/img/6.png
|
8 |
-
7;Plantations_Segmentation/img/7.png
|
9 |
-
8;Plantations_Segmentation/img/8.png
|
10 |
-
9;Plantations_Segmentation/img/9.png
|
11 |
-
10;Plantations_Segmentation/img/10.png
|
12 |
-
11;Plantations_Segmentation/img/11.png
|
13 |
-
12;Plantations_Segmentation/img/12.png
|
14 |
-
13;Plantations_Segmentation/img/13.png
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plantations_segmentation.py
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import datasets
|
2 |
+
import pandas as pd
|
3 |
+
|
4 |
+
_CITATION = """\
|
5 |
+
@InProceedings{huggingface:dataset,
|
6 |
+
title = {plantations_segmentation},
|
7 |
+
author = {TrainingDataPro},
|
8 |
+
year = {2023}
|
9 |
+
}
|
10 |
+
"""
|
11 |
+
|
12 |
+
_DESCRIPTION = """\
|
13 |
+
The dataset consist of screenshots from videos of basketball games with
|
14 |
+
the ball labeled with a bounging box.
|
15 |
+
The dataset can be used to train a neural network in ball control recognition.
|
16 |
+
The dataset is useful for automating the camera operator's work during a match,
|
17 |
+
allowing the ball to be efficiently kept in frame.
|
18 |
+
"""
|
19 |
+
_NAME = 'plantations_segmentation'
|
20 |
+
|
21 |
+
_HOMEPAGE = f"https://huggingface.co/datasets/TrainingDataPro/{_NAME}"
|
22 |
+
|
23 |
+
_LICENSE = ""
|
24 |
+
|
25 |
+
_DATA = f"https://huggingface.co/datasets/TrainingDataPro/{_NAME}/resolve/main/data/"
|
26 |
+
|
27 |
+
|
28 |
+
class PlantationsSegmentation(datasets.GeneratorBasedBuilder):
|
29 |
+
"""Small sample of image-text pairs"""
|
30 |
+
|
31 |
+
def _info(self):
|
32 |
+
return datasets.DatasetInfo(
|
33 |
+
description=_DESCRIPTION,
|
34 |
+
features=datasets.Features({
|
35 |
+
'image_id': datasets.Value('int32'),
|
36 |
+
'image': datasets.Image(),
|
37 |
+
'class_segmentation': datasets.Image(),
|
38 |
+
'object_segmentation': datasets.Image(),
|
39 |
+
'shapes': datasets.Value('string')
|
40 |
+
}),
|
41 |
+
supervised_keys=None,
|
42 |
+
homepage=_HOMEPAGE,
|
43 |
+
citation=_CITATION,
|
44 |
+
)
|
45 |
+
|
46 |
+
def _split_generators(self, dl_manager):
|
47 |
+
images = dl_manager.download(f"{_DATA}images.tar.gz")
|
48 |
+
class_segmentation_masks = dl_manager.download(
|
49 |
+
f"{_DATA}class_segmentation.tar.gz")
|
50 |
+
object_segmentation_masks = dl_manager.download(
|
51 |
+
f"{_DATA}object_segmentation.tar.gz")
|
52 |
+
annotations = dl_manager.download(f"{_DATA}{_NAME}.csv")
|
53 |
+
images = dl_manager.iter_archive(images)
|
54 |
+
class_segmentation_masks = dl_manager.iter_archive(
|
55 |
+
class_segmentation_masks)
|
56 |
+
object_segmentation_masks = dl_manager.iter_archive(
|
57 |
+
object_segmentation_masks)
|
58 |
+
return [
|
59 |
+
datasets.SplitGenerator(
|
60 |
+
name=datasets.Split.TRAIN,
|
61 |
+
gen_kwargs={
|
62 |
+
"images": images,
|
63 |
+
'class_segmentation_masks': class_segmentation_masks,
|
64 |
+
'object_segmentation_masks': object_segmentation_masks,
|
65 |
+
'annotations': annotations
|
66 |
+
}),
|
67 |
+
]
|
68 |
+
|
69 |
+
def _generate_examples(self, images, class_segmentation_masks,
|
70 |
+
object_segmentation_masks, annotations):
|
71 |
+
annotations_df = pd.read_csv(annotations)
|
72 |
+
|
73 |
+
for idx, ((image_path, image), (class_segmentation_path,
|
74 |
+
class_segmentation),
|
75 |
+
(object_segmentation_path,
|
76 |
+
object_segmentation)) in enumerate(
|
77 |
+
zip(images, class_segmentation_masks,
|
78 |
+
object_segmentation_masks)):
|
79 |
+
yield idx, {
|
80 |
+
'image_id':
|
81 |
+
annotations_df.loc[
|
82 |
+
annotations_df['image_name'] == image_path]
|
83 |
+
['image_id'].values[0],
|
84 |
+
"image": {
|
85 |
+
"path": image_path,
|
86 |
+
"bytes": image.read()
|
87 |
+
},
|
88 |
+
"class_segmentation": {
|
89 |
+
"path": class_segmentation_path,
|
90 |
+
"bytes": class_segmentation.read()
|
91 |
+
},
|
92 |
+
"object_segmentation": {
|
93 |
+
"path": object_segmentation_path,
|
94 |
+
"bytes": object_segmentation.read()
|
95 |
+
},
|
96 |
+
'shapes':
|
97 |
+
annotations_df.loc[
|
98 |
+
annotations_df['image_name'] == image_path]
|
99 |
+
['shapes'].values[0]
|
100 |
+
}
|