2017-09-10 4 views
2

큰 이미지 (6000x4000)가 있습니다. 아주 작은 물체를 감지하기 위해 FasterRCNN을 훈련시키고 싶습니다. 따라서 메모리 용도로는 이미지를 1000x1000으로 자릅니다. 훈련은 괜찮습니다. 1000x1000에서 모델을 테스트 할 때 결과는 정말 좋습니다. 내가 6000x4000의 이미지에서 모델을 테스트 할 때 결과는 정말 나쁘다 ...빠른 RCNN 텐서 흐름 객체 탐지 ​​API : 큰 이미지 처리

나는 지역 제안 단계라고 생각하지만 내가 뭘 잘못하고 있는지 알지 못한다. (keep_aspect_ratio_resizer max_dimension은 12000으로 수정 됨) ...

도움 주셔서 감사합니다.

답변

0

대략 동일한 차원으로 테스트하기 위해 이미지와 이미지를 훈련시켜야합니다. 데이터 확대 기능으로 랜덤 리사이징을 사용하는 경우 테스트 이미지의 크기를 대략적으로 변경할 수 있습니다.

이 문제를 해결하는 가장 좋은 방법은 큰 이미지를 훈련에 사용 된 것과 같은 차원의 이미지로 자른 다음 작물에 비 최대 억제를 사용하여 예측을 병합하는 것입니다.

그런 식으로하면, 검출 할 가장 작은 물체가 50px 크기라면 500px 크기의 트레이닝 이미지를 가질 수 있습니다.

+0

나는 더 빠른 RCNN의 matlab 구현에서 그것을 풀어 낼 수있다. 나는 좋은 결과를 가지고있다 ... 그래서 이것은 문제가되어서는 안된다. –

+0

그리고 또 다른 문제는 폐색 된 객체를 추가한다. 이미지 –

1

테스트중인 것보다 다른 종횡비의 이미지를 학습하는 것처럼 보입니다 (정사각형이 아닌 정사각형) - 이로 인해 품질이 크게 저하 될 수 있습니다.

솔직히 말해서 시각적으로 평가하는 경우 결과가 일 수 있다고 놀랍습니다. 어쩌면 시각화 점수 임계 값을 낮춰야 할 수도 있습니다.

+0

, 개체가 같은 크기를 가지고 ... 내가 MATLAB과 RCNN을 빠른 테스트 동일한 프로토콜로 결과가 정말 좋습니다. 그래서 tensorflow (또는 나는 나의 편에서 나쁜 초기화)에서 확실히 문제입니다. –

+0

그리고 나도 나쁜 결과가 정말 놀랍다. –

0

귀하의 케이스에서 4000보다 큰 min_dimension이 무엇인지 알고 싶습니다. 그렇지 않으면 이미지가 축소됩니다.

는 object_detection-> 코어 -> preprocessor.py

없음 이미지가 동일한 프로토콜을 취득한

def _compute_new_dynamic_size(image, min_dimension, max_dimension): """Compute new dynamic shape for resize_to_range method.""" image_shape = tf.shape(image) orig_height = tf.to_float(image_shape[0]) orig_width = tf.to_float(image_shape[1]) orig_min_dim = tf.minimum(orig_height, orig_width) # Calculates the larger of the possible sizes min_dimension = tf.constant(min_dimension, dtype=tf.float32) large_scale_factor = min_dimension/orig_min_dim # Scaling orig_(height|width) by large_scale_factor will make the smaller # dimension equal to min_dimension, save for floating point rounding errors. # For reasonably-sized images, taking the nearest integer will reliably # eliminate this error. large_height = tf.to_int32(tf.round(orig_height * large_scale_factor)) large_width = tf.to_int32(tf.round(orig_width * large_scale_factor)) large_size = tf.stack([large_height, large_width]) if max_dimension: # Calculates the smaller of the possible sizes, use that if the larger # is too big. orig_max_dim = tf.maximum(orig_height, orig_width) max_dimension = tf.constant(max_dimension, dtype=tf.float32) small_scale_factor = max_dimension/orig_max_dim # Scaling orig_(height|width) by small_scale_factor will make the larger # dimension equal to max_dimension, save for floating point rounding # errors. For reasonably-sized images, taking the nearest integer will # reliably eliminate this error. small_height = tf.to_int32(tf.round(orig_height * small_scale_factor)) small_width = tf.to_int32(tf.round(orig_width * small_scale_factor)) small_size = tf.stack([small_height, small_width]) new_size = tf.cond( tf.to_float(tf.reduce_max(large_size)) > max_dimension, lambda: small_size, lambda: large_size) else: new_size = large_size return new_size

+0

을 6000 –

+0

이상으로 자르면 first_stage_max_proposal과 상대 postprocess가 결과에 영향을 줄 수 있습니다. 큰 원격 감지 이미지에서이 방법을 테스트하고 있습니다. 결과가 나면 당신과 이야기 할 것입니다. –

+0

고마워, 이미지 자르기 모델을 사용하고 있지만 일부 occluded 개체가 ... 테스트 주셔서 감사합니다 –

관련 문제