# Pesteh-Set **Repository Path**: TimVerion/Pesteh-Set ## Basic Information - **Project Name**: Pesteh-Set - **Description**: Pesteh-Set, the pistachios dataset from the paper https://arxiv.org/abs/2005.03990 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-06-27 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Pesteh-Set : A New Dataset of Different Types of Pistachios Pistachio is a nutritious nut that has many uses in the food industry. Iran is one of its largest producers, and pistachio is considered as a strategic export product for this country. This product has a great variety, most of which are cultivated in Iran and taken to other countries. Pistachios are sorted based on the shape of their shell into two categories: Open-mouth and Closed-mouth. The open-mouth pistachios are higher in price, value, and demand than the closed-mouth pistachios. In the countries that are famous in pistachio production and exporting, there are companies that pack the picked pistachios from the trees and make them ready for exporting. As there are differences between the price and the demand of the open-mouth and closed-mouth pistachios, it is considerable for these companies to know precisely how much of these two kinds of pistachios exist in each packed package. We have introduced and shared a new dataset of pistachios. Pistachio is known as Pesteh in Iran, and that is why we called our dataset Pesteh-Set.
Pistachios Assortment
The General View of how Pesteh-Set was recoreded and our proposed way for counting the pistachios
The [self-developed program](Label_maker.py) for labeling the images along all the codes designed for preparing and visualzing the data is avaialbe on this repository. We hope that researchers could use them to make the Pistachio-Dataset larger.
The details of the Pesteh-Set are listed in the next table.
Data | Open-Mouth Pistachios | Closed-Mouth Pistachios | ALL the Pistachios
------------ | ------------- | ------------- | -------------
Video1 | 50 | 20 | 70
Video2 | 60 | 20 | 80
Video3 | 70 | 20 | 90
Video4 | 90 | 20 | 110
Video5 | 100 | 20 | 120
Video6 | 39 | 52 | 91
All of the Videos | 409 | 152 | 561
All the 423 Labeld Images | 1993 | 1934 | 3927
Clone this repository by ```!git clone https://github.com/mr7495/Pesteh-Set.git```
You can use ```!python frame_generator.py --video_path="Path to the Video" --save_folder="Path to write the frames" --height="height of the frame" --width="width of the frame"``` to extract the frames of the videos.
You can extract more frames from the videos in our dataset and use the Label_maker module to label more images and increase the number of images in the dataset.
# Label Maker
[Label Maker](Label_maker.py) has been developed for making the ground truth of the images. In this case, as we have two classes of pistachios, the label maker is set to label two classes of objects.
The output of this program is a set of CSV files that each belongs to an image. One example of a row in a generated CSV file is :
```image_name, x1, y1, x2, y2, class_num```
This format is the format that RetinaNet accepts as the CSV annotation.
This program can be ran by :
```!python Label_maker.py --images_path="path to the images folder" --save_path="The path to save csv files"```
For each image, draw the box around the object and press enter, then press 0 or 1. 0 is referred to class 1, and 1 is referred to class2.
If you press any other keys after pressing enter, the selected box would be rejected.
If you want to go to the next image, select a random box, press enter, then press n.
if you want to quit, select a random box, press enter, then press e
The [visualization.py](visualization.py) presents the code for plotting the annotation on the images. Run as:
```!python visualization.py --annotation_path="Path to annotation.csv" --images_path="Path to the dataset images" --save_path="Path to write the plotted images" ```
**Ground Truth of Pesteh-Set is available in the [annotation.csv](annotation.csv).**
**The Pesteh-Set images are available in the [pesteh_set_images folder](pesteh_set_images).**
**The Videos of Pesteh-Set is shared on Google Drive and Mendeley:**