go-yolo icon indicating copy to clipboard operation
go-yolo copied to clipboard

very good library but not very convenient to work with.

Open deepch opened this issue 7 years ago • 10 comments

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) } }

deepch avatar Jan 06 '18 02:01 deepch

I don't catch your meaning. Could you explain more clearly?

yummybian avatar Jan 09 '18 04:01 yummybian

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

deepch avatar Jan 09 '18 14:01 deepch

apparently you do not need.

deepch avatar Jan 18 '18 23:01 deepch

Indeed, the function yolo.ImageDetector can't return anything, and it just generates a file on the disk.

yummybian avatar Jan 24 '18 06:01 yummybian

do not you think it would be more convenient to get the coordinates and name of the objects?

deepch avatar Jan 25 '18 04:01 deepch

I will do some workaround for more convenient to use.

yummybian avatar Jan 25 '18 23:01 yummybian

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

yummybian avatar Feb 20 '18 13:02 yummybian

and this will not lead to an overload? Will not it ever initiate a network?

deepch avatar Feb 22 '18 00:02 deepch

Yes, You need to initiate the network every time.

yummybian avatar Feb 22 '18 01:02 yummybian

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.

deepch avatar Feb 22 '18 02:02 deepch