|
OCR Project
|
Binary save/load of CNN weights and latest-model discovery. More...

Functions | |
| int | model_save (const CNN *net, const char *path) |
| Save the weights of a trained CNN to a binary file. | |
| int | model_load (CNN *net, const char *path) |
Load CNN weights from a binary file into net. | |
| int | model_find_latest (const char *dir, char *out_path, size_t out_len) |
| Find the most recently modified .bin file inside a directory. | |
Binary save/load of CNN weights and latest-model discovery.
| int model_find_latest | ( | const char * | dir, |
| char * | out_path, | ||
| size_t | out_len ) |
Find the most recently modified .bin file inside a directory.
Iterates over all regular files with a ".bin" suffix in dir and returns the one with the highest mtime.
| dir | Directory to search (e.g. "models/"). |
| out_path | Buffer that receives the full path of the chosen file. |
| out_len | Size of out_path in bytes. |
out_path, -1 if the directory is empty or cannot be opened. 
| int model_load | ( | CNN * | net, |
| const char * | path ) |
Load CNN weights from a binary file into net.
Validates the magic number and version before reading. If validation fails, net is left unchanged.
| net | CNN to load weights into. Must not be NULL. |
| path | Source file path. |

| int model_save | ( | const CNN * | net, |
| const char * | path ) |
Save the weights of a trained CNN to a binary file.
Creates or overwrites the file at path. The directory must exist.
| net | CNN whose weights should be saved. Must not be NULL. |
| path | Destination file path (e.g. "models/my_model.bin"). |
