Here's a simple function that takes in a folder path with images and their corresponding labels in the file name, and saves them into a database.
main.m1096 chars35 lines
Here's an example of how the function can be called:
main.m134 chars6 lines
This function creates a new SQLite database (dbName
) if it doesn't already exist, creates a table (tableName
) in the database if it doesn't exist, and inserts each image in the folder (folderPath
) with its label (extracted from the filename) as a new row in the table. The image data is stored as a binary large object (BLOB) in the database.
gistlibby LogSnag