Skip to content
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,11 @@ For instance, [Stanford bunny LICENSE](points/bunny/LICENSE) applies to [Stanfor
| Model Name | Source | Description |
|------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Topological Wheels](timeseries/topological_wheels/tw-data-annotated.png) | [DataShape](https://www.inria.fr/fr/datashape) | 10 CSV files where each file has 64 timeseries over 10000 timestamps each, and a $y$ ground truth indicating anomalous regime. See [README](timeseries/topological_wheels/README.md). |

## Images

| Model Name | Source | Description |
|------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Flavia leaves](images/flavia/flavia_convexity.csv.gz) | [Flavia](https://flavia.sourceforge.net/)[^1] | Compressed CSV file with 1907 flattened black & white images (900 first values) and the image convexity value (last column value). |

[^1]: *Stephen Gang Wu, Forrest Sheng Bao, Eric You Xu, Yu-Xuan Wang, Yi-Fan Chang and Chiao-Liang Shiang, A Leaf Recognition Algorithm for Plant classification Using Probabilistic Neural Network, IEEE 7th International Symposium on Signal Processing and Information Technology, Dec. 2007, Cario, Egypt*
56 changes: 56 additions & 0 deletions images/flavia/data_selecta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Based on https://github.com/renata-turkes/turkevs2022on/blob/main/SRC/data_construction.py
# Author: Renata Turkeš
# This file is part of the Gudhi Library - https://gudhi.inria.fr/ -
# which is released under MIT.
# Author(s): Sean Bontemps, Vincent Rouvreau
#
# Copyright (C) 2024 Inria
#
# Modification(s):
# - YYYY/MM Author: Description of the modification

import argparse
import os
import numpy as np
from PIL import Image
from skimage.morphology import convex_hull_image

#
# This program requires to load data from https://sourceforge.net/projects/flavia/files/Leaf%20Image%20Dataset/1.0/Leaves.tar.bz2/download
# This dataset is based on the paper A Leaf Recognition Algorithm for Plant classification Using Probabilistic Neural Network, by
# Stephen Gang Wu, Forrest Sheng Bao, Eric You Xu, Yu-Xuan Wang, Yi-Fan Chang and Qiao-Liang Xiang, published at
# IEEE 7th International Symposium on Signal Processing and Information Technology, Dec. 2007.
#
# Unzip the data and copy data_selecta.py in a same directory data folder
# Launch 'python data_selecta.py -s /my/path/to/flavia'
# Generated with Python 3.8 / Pandas 1.1.0
#

parser = argparse.ArgumentParser(
description="Reads all the images from a source_directory, converts them to (image_size x image_size) black &"
" white images, computes their convexity. The final numpy ndarray (number of images x (image_size x image_size + 1)"
" is saved in a destination_file."
)
parser.add_argument("-s", "--source_directory", type=str, default="flavia")
parser.add_argument("-d", "--destination_file", type=str, default="flavia_convexity.npy")
parser.add_argument("-i", "--image_size", type=int, default=30)

args = parser.parse_args()

data = []
for image in sorted(os.listdir(args.source_directory)):
if image.endswith('.jpg'):
file_name = args.source_directory + "/" + image
# print(file_name)
img = Image.open(args.source_directory + "/" + image)
# Convert image in gray scale and resize
img = img.convert('L').resize((args.image_size,args.image_size), Image.LANCZOS)
# Black & white image at a specific threshold
img_bw = img < 0.9 * np.max(img)
img_bw_ch = convex_hull_image(img_bw, offset_coordinates = False)
convexity = np.sum(img_bw) / np.sum(img_bw_ch)
data_line = np.append(img_bw.astype(float).reshape(args.image_size * args.image_size), convexity)
data.append(data_line)

data = np.asarray(data)
np.save(args.destination_file, data, allow_pickle=False)
11 changes: 11 additions & 0 deletions images/flavia/flavia.LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The original dataset comes from
https://sourceforge.net/projects/flavia/files/Leaf%20Image%20Dataset/1.0/Leaves.tar.bz2/download

This dataset is based on the paper A Leaf Recognition Algorithm for Plant classification Using Probabilistic Neural
Network, by Stephen Gang Wu, Forrest Sheng Bao, Eric You Xu, Yu-Xuan Wang, Yi-Fan Chang and Qiao-Liang Xiang, published
at IEEE 7th International Symposium on Signal Processing and Information Technology, Dec. 2007.

Please read carefully the terms of use of this dataset (https://flavia.sourceforge.net/) before using it.

The images have been black and whited, resized in 30 x 30 and then flattened. The last column of the dataset is the
convexity value. Please refer to data_selecta.py for more details.
Binary file added images/flavia/flavia_convexity.csv.gz
Binary file not shown.
Binary file added images/flavia/flavia_convexity.npy
Binary file not shown.