go-yolo
go-yolo copied to clipboard
very good library but not very convenient to work with.
If you could feed as a decoder
yolo = int_func()
for { image, err = get_image_other_sourece() if err == nil { result, err := yolo.detect_image(image) } }
I don't catch your meaning. Could you explain more clearly?
forgive me for bad english.
Your example fits well if there is one image.
But if I have 100, and I get them every second.
It would be great if there was no need to initialize.
sample python api
https://github.com/pjreddie/darknet/blob/master/python/darknet.py
r = detect(net, meta, "data/dog.jpg")
I can here just call a function in a loop
while True:
r = detect(net, meta, "data/any_new_image.jpg")
print r
apparently you do not need.
Indeed, the function yolo.ImageDetector can't return anything, and it just generates a file on the disk.
do not you think it would be more convenient to get the coordinates and name of the objects?
I will do some workaround for more convenient to use.
You can specify the different output name in a loop.
yolo.ImageDetector(
"./cfg/coco.data", // datacfg
"./cfg/yolo.cfg", // cfgfile
"./yolo.weights", // weightfile
"./data/dog.jpg", // image that you want recognize
0.24, // thresh default: 0.24
0.5, // hierThresh default: 0.5
"/PATHTO/A_IMAGE_NAME") // ignore the suffix
and this will not lead to an overload? Will not it ever initiate a network?
Yes, You need to initiate the network every time.
but why? in the examples there is no need to do this. So I suggest adding a function. init which will do this once. sample on ffmpeg int h264dec_new and h264dec_decode https://github.com/deepch/old_codec/blob/master/h264dec.go
func int
void new_decoder(char *datacfg, char *cfgfile, char *weightfile, char *filename, float thresh, float hier_thresh, char *outfile) {
list *options = read_data_cfg(datacfg);
char *name_list = option_find_str(options, "names", "data/names.list");
char **names = get_labels(name_list);
image **alphabet = load_alphabet();
return load_network(cfgfile, weightfile, 0);
}
like that. and it will be possible to use the network again this will greatly accelerate the process.