inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

TensorFlow Object Detection API 가이드 Part1 - 코드 10줄 수정으로 물체검출하기

이미지 사이즈 에러 발생

560

hewun7427

작성한 질문수 1

0

ValueError                                Traceback (most recent call last)
<ipython-input-36-bb063d6d7f72> in <module>()
      1 image_dir = 'images_person/'
      2 image_path = os.path.join(image_dir, 'person_picture:001.png')
----> 3 image_np = load_image_into_numpy_array(image_path)
      4 
      5 # 이미지에 대한 예측을 수행합니다.

<ipython-input-35-aa041491b700> in load_image_into_numpy_array(path)
     17 
     18   return np.array(image.getdata()).reshape(
---> 19       (im_height, im_width, 3)).astype(np.uint8)

ValueError: cannot reshape array of size 1344384 into shape (432,778,3)

제가 새로운 이미지파일로 object detection을 실행하고 있는데 사이즈가 달라서 오류가 나는거 같습니다.
어떻게 해결해야 하나요?

tensorflow 딥러닝 cnn

답변 2

0

hewun7427

해결됐습니다.

감사합니다.

0

AISchool

안녕하세요~. 반갑습니다.

이미지가 RGB가 아니라 grayscale로 처리되어서 발생한 에러가 아닐까 의심됩니다.

load_image_into_numpy_array 함수안에 있는 아래 2줄을 아래와 같이 변경 해서 진행해보세요.

img_data = tf.io.gfile.GFile(path, 'rb').read()

image = Image.open(BytesIO(img_data))

->

image = Image.open(path).convert("RGB")

감사합니다.

보드 관련 질문 드립니다.

1

51

2

[개정판] 딥러닝 컴퓨터 비전 완벽 가이드 먼저? 구현하며 배우는 Transformer 먼저?

0

57

1

수업자료

0

42

2

paperswithcode 서비스 종료 관련 문의

0

274

2

버전 오류 23.05파일 포함.

0

225

1

python -m pip install . 이 아예 안되서 전체 다 수행할 수 없습니다.

0

389

1

1강 colab 2022-11-11 파일도 안됩니다.

1

605

2

강의 슬라이드 전달 요청

1

386

1

TensorFlow Object Detection API Deprecation 영향 문의

0

372

0

1강_TF2_Detection_Model_ZOO_example_fasterrcnn_pedestrian_dataset.ipynb 내 파일 실행 실패

0

461

1

Person Detection 에러 질문

0

248

1

사용법

0

399

2

확장자 변경

0

275

0

Faster R-CNN을 이용한 Person Detection 에서 오류

0

293

1

mportError: cannot import name 'BaseRandomLayer' from 'keras.engine.base_layer' (/usr/local/lib/python3.7/dist-packages/keras/engine/base_layer.py) 오류 문의합니다.

0

563

2

PPT자료 어디에 있나요??

0

309

0

실사가 아닌 경우에도 잘 검출이 될까요?

0

361

1

error

0

187

1

Person Detection 관련 문의

0

255

1

CenterNet을 이용한 Car Detection

0

233

0

Faster R-CNN을 이용한 Car Detection 코랩 링크 관련 문의

0

340

1

yolo annotation 문의

0

351

1

Average Recall 질문

0

531

1

강의 교재

0

311

1