MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / read_cfg

Function read_cfg

yolo_detector/darknet_opt/src/parser.c:770–803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

768}
769
770list *read_cfg(char *filename)
771{
772 FILE *file = fopen(filename, "r");
773 if(file == 0) file_error(filename);
774 char *line;
775 int nu = 0;
776 list *options = make_list();
777 section *current = 0;
778 while((line=fgetl(file)) != 0){
779 ++ nu;
780 strip(line);
781 switch(line[0]){
782 case '[':
783 current = malloc(sizeof(section));
784 list_insert(options, current);
785 current->options = make_list();
786 current->type = line;
787 break;
788 case '\0':
789 case '#':
790 case ';':
791 free(line);
792 break;
793 default:
794 if(!read_option(line, current->options)){
795 fprintf(stderr, "Config file error line %d, could parse: %s\n", nu, line);
796 free(line);
797 }
798 break;
799 }
800 }
801 fclose(file);
802 return options;
803}
804
805void save_convolutional_weights_binary(layer l, FILE *fp)
806{

Callers 1

parse_network_cfgFunction · 0.85

Calls 6

file_errorFunction · 0.85
make_listFunction · 0.85
fgetlFunction · 0.85
stripFunction · 0.85
list_insertFunction · 0.85
read_optionFunction · 0.85

Tested by

no test coverage detected