How to create dataset in the same format as the FSNS dataset?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
Creating a dataset in the same format as the French Street Name Signs (FSNS) dataset requires an understanding of both the structure and the content of the original dataset. FSNS is utilized for Optical Character Recognition (OCR) applications, especially suited for text recognition in natural scene images. This dataset is organized in the TFRecord format and contains data optimized for deep learning models.
Dataset Format and Structure
FSNS Dataset Essentials
The FSNS dataset includes street signs from multiple cities and is designed with variations in scripts and languages. Here's an overview of the essential components:
- Images: High-resolution images of street signs.
- Labels: Text information corresponding to each image.
- Meta-information: Includes details like file location, data split identifiers, etc.
File Organization
- TFRecord: FSNS uses TFRecord, a TensorFlow format for storing a sequence of binary records. It efficiently stores large amounts of data and is commonly used in TensorFlow workflows.
- Metadata: Associated JSON or CSV files contain meta-information for indexing and access.
Data Features
Each example in a TFRecord consists of an encoded image and its label stored as features. The essential features are:
image/encoded: The encoded image data.image/format: The image format (e.g., JPEG, PNG).image/class/label: The label or text corresponding to the image.
Steps to Create a Dataset in the Same FSNS Format
1. Image Collection
First, gather your set of high-resolution images. These should be organized in directories that signify their classes or labels.
2. Annotation
Label the images appropriately. Each image should have an associated label, which could be done using annotation tools like LabelImg or via a CSV/JSON file that maps filenames to labels.
3. Convert Images to TFRecord
To convert your annotated data into TFRecord, follow these steps:
Define Feature Function
Create a helper function to convert image data into TensorFlow features:

