На мой разумный новый MBP уходит более 6 минут на каждое изображение, чтобы сделать вывод о моделях iNat (2854 класса). Другие модели намного быстрее, но бесполезны для меня, так как я хочу боксировать (и узнавать) насекомых.
352.11440205574036
{'num_detections': 5, 'detection_boxes': array([[0.161314 , 0.07663244, 0.8760584 , 0.8353734 ],
[0.21500829, 0.15136112, 0.8591431 , 0.77994514],
[0.2097887 , 0.15024516, 0.798306 , 0.7945756 ],
[0.22616749, 0.14413752, 0.8274681 , 0.78175414],
[0.23031202, 0.1721791 , 0.8461484 , 0.7838437 ]], dtype=float32), 'detection_scores': array([0.49970442, 0.07632057, 0.07298005, 0.06298006, 0.03536102],
dtype=float32), 'detection_classes': array([ 2, 248, 9, 155, 198], dtype=uint8)}
29469691 function calls (29323558 primitive calls) in 471.230 seconds
Ordered by: cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
2740/1 0.044 0.000 471.234 471.234 {built-in method builtins.exec}
1 0.319 0.319 471.227 471.227 detect_insect.py:1(<module>)
1 0.004 0.004 355.473 355.473 detect_insect.py:72(run_inference_for_single_image)
1 0.001 0.001 352.112 352.112 session.py:846(run)
1 0.002 0.002 352.111 352.111 session.py:1091(_run)
1 0.000 0.000 352.096 352.096 session.py:1318(_do_run)
1 0.000 0.000 352.096 352.096 session.py:1363(_do_call)
1 0.001 0.001 352.096 352.096 session.py:1346(_run_fn)
1 0.002 0.002 347.445 347.445 session.py:1439(_call_tf_sessionrun)
1 347.443 347.443 347.443 347.443 {built-in method _pywrap_tensorflow_internal.TF_SessionRun_wrapper}
1 0.441 0.441 56.288 56.288 request.py:1775(retrieve)
85287 0.176 0.000 52.912 0.001 tempfile.py:479(func_wrapper)
85287 0.589 0.000 52.735 0.001 client.py:436(read)
85286 0.328 0.000 51.999 0.001 client.py:468(readinto)
85286 0.487 0.000 51.645 0.001 {method 'readinto' of '_io.BufferedReader' objects}
159149 0.374 0.000 51.280 0.000 socket.py:575(readinto)
159149 50.610 0.000 50.610 0.000 {method 'recv_into' of '_socket.socket' objects}
25 0.000 0.000 35.959 1.438 deprecation.py:473(new_func)
1 0.000 0.000 35.956 35.956 importer.py:347(import_graph_def)
1 0.001 0.001 35.956 35.956 importer.py:415(_import_graph_def_internal)
1 0.489 0.489 19.450 19.450 importer.py:237(_ProcessNewOps)
1 0.290 0.290 13.701 13.701 ops.py:3542(_add_new_tf_operations)
1 0.106 0.106 11.004 11.004 ops.py:3560(<listcomp>)
1 10.931 10.931 10.931 10.931 {built-in method _pywrap_tensorflow_internal.TF_GraphImportGraphDefWithResults}
Any advice?