문제 설명
훈련된 신경망을 사용하여 이미지에서 여러 객체를 식별하는 방법은 무엇입니까? (How do you use a trained neural net to identify multiple objects in an image?)
저는 신경망을 탐색해 왔으며 개별 사진에 특정 항목을 지정하는 방식으로 내 자신의 이미지에서도 네트워크를 성공적으로 훈련할 수 있었지만 훈련된 네트워크를 사용하여 식별하고 아마도 하나의 이미지에서 여러 객체를 반환합니다. 예를 들어, 고양이와 개를 훈련시켰고 하나의 이미지에 여러 고양이와 개가 있는 경우 훈련된 네트워크를 어떻게 적용하고 이미지에서 위치를 반환할까요?
여기에 제가 따라한 주요 튜토리얼이 있습니다. Python 구현: http://machinelearningmastery. com/object‑recognition‑convolutional‑neural‑networks‑keras‑deep‑learning‑library/
일반적인 대답으로 충분할 것입니다. 예를 들어 이미지 위의 슬라이딩 윈도우가 이에 대한 최상의 솔루션입니까 아니면 더 쉬운 것이 있습니까?
특정 예(특히 파이썬에서)를 주시면 감사하겠습니다. 저는 대부분의 이미지 작업에 matplotlib를 사용하고 있으므로 PIL 슬라이싱을 피하고 싶습니다.
감사합니다!
참조 솔루션
방법 1:
As you want to use your existing trained n/w:
- Brute Sliding window: you will have to process many windows (slide by pixel based on image size) if you don't know the size and location of the object in the image, and each window may produce different outcomes and may be one or few of those are the final required results, do you see how the complexity increases. There will be difficulty in identifying the actual required outcomes among many.
- Preprocessing: images can be preprocessed before feeding it to the network. For instance, take an image with a monkey and a snake, calculate energy (Sobel et.al) of the image. Monkeys footprint in the image is more like round balloon (more area) and snake would be thread‑like (less area), based on this have a python script to crop the image to that particular section, then feed this to the n/w. You can think of other preprocessing techniques.
If you are open to other n/w's, check out CRF as Recurrent Neural Networks. Ex: https://github.com/torrvision/crfasrnn
Hope this helps.