pip install qwen-vl-utils
- pip install 'accelerate>=0.26.0' (PC 실행 시)
- 1차 시도 (긴 이미지)
- 예제코드 중 수정사항 (PC 사용을 위해)
- inputs = inputs.to("cpu")
- max_pixels = 512*28*28 (default: 1280*28*28)
Default 프롬프트 사용: "Describe this image"
- 이미지 url="https://sedam01.hgodo.com/event/202502/sb_tdeal_brand_event_20250121.jpg" (스타벅스, 세로로 긴 이미지 1: 12 정도)
- 결과: ['The image is a promotional email from T-Deal, a Korean online shopping platform, featuring a special event for Starbucks. The email is titled "2025 첫, 브랜드데이" and includes various promotional offers and deals for Starbucks products.\n\n### Header:\n- **Special Event**: "2025 첫, 브랜드데이"\n- **T-Deal**: "T deal"\n- **Starbucks**: "스타벅스"\n\n### Main Content:\n1. **Promotional Offers**:\n - **Promotion 01**: \n - **Bundle Offer**:
- 5,']
- 소요시간: 5분
- 2차 시도 (일반 이미지)
- Default 프롬프트 사용: "Describe this image"
- 결과: ["This image is a promotional advertisement for an online wholesale platform. The text is in Korean and provides information about the platform's services and policies. Here is a detailed description:\n\n### Advertisement Text\n\n**Title:**\n일양약품 온라인 공식판매처\n\n**Description:**\n본 제품은 일양약품과 정식 OEM 계약을 하고 적법한 절차에 따른 심사를 통해 본사가 독점으로 운영하는 상품입니다.\n\n**Additional Information:**\n본 제품의 저작권은
- 주씨엔에스헬스케어에게 있으며 따라서 제품의 상표"]
- 소요시간: 4분
- 결과 분석: 글자의 일부를 빼먹음
- 3차 시도 (스타벅스, 긴 이미지에 대한 프롬프트 엔지니어링)
- 프롬프트 엔지니어링: "You are an OCR reader. For a given image, read the characters as accurately as possible and send back the literal result of your reading. Do not summarize or interpret your reading."
- 결과: ['(135,117),(869,879)']
- 소요시간: 4분
- 결과 분석: 없음
- 4차 시도 (일반 이미지에 대한 프롬프트 엔지니어링)
- 프롬프트 엔지니어링: "You are an OCR reader. For a given image, read the characters as accurately as possible and send back the literal result of your reading. Do not summarize or interpret your reading."
- 이미지 url="https://tdeal.cdn-nhncommerce.com/20240711/110817.582265000/%EA%B3%B5%EC%8B%9D%ED%8C%90%EB%A7%A4%EC%B2%98_%EC%9D%BC%EC%96%91%EC%95%BD%ED%92%88.jpg" (일양약품 header 안내)
- 결과: ['일양약품 온라인 공식판매처\n\n본 제품은 일양약품과 정식 OEM 계약을 하고 적법한 절차에 따른 심사를 통해 본사가 독점으로 운영하는 상품입니다.\n\n[권련법규]\n\n상표법 제58(손실보장청구권), 제109조(손해배상의 청구), 제89조(상품
- 의 효력), 제95조(전용사용권) 등\n\n재판매 의심 주문 임의 취소 안내']
- 소요시간: 4분
- 결과 분석: 글자의 일부를 빼먹음
- 5차 시도 (일반 이미지에 대한 프롬프트 엔지니어링, 토큰 수 증대: 512)
- 코드(옵션) 수정사항: max_new_tokens 수 512 (default=128)
- generated_ids = model.generate(**inputs, max_new_tokens=512)
- 결과: ['일양약품 온라인 공식판매처\n\n본 제품은 일양약품과 정식 OEM 계약을 하고 적법한 절차에 따른 심사를 통해 본사가 독점으로 운영하는 상품입니다.\n\n[권련법규]\n\n상표법 제58(손실보장청구권), 제109조(손해배상의 청구), 제89조(상품
- 의 효력), 제95조(전용사용권) 등\n\n재판매 의심 주문 임의 취소 안내\n\n소비자를 가장해 상품을 구매한 후 재판매하는 경우 주문이 자동으로 취소 될 수 있습니다.\n\n※온라인 공식 판매처 인증이 없고 불법 재판매하는 사업자를 통해 구매
- 하신 상품은 품질보증, 제품안내, 배송 및 교환, 환불 등 고객지원이 불가능하니 참고 부탁드립니다.']
- 소요시간: 6분
- 결과 분석: 5차까지 시도 중 가장 좋은 결과를 얻었으나. 일부 누락된 글자가 있고, 소요시간이 다소 더 걸림
- 누락 글자: 본 제품의 저작권은 (주)씨엔에스헬스케어에게 있으며 따라서 제품의 상표권, 상세이미지, 촬영이미지 등 모든 컨텐츠는 저작권의 보호를 받으며 무단 복제, 도용, 배포시 민.형사상의 불이익을 받을 수 있습니다."
- 6차 시도 (일반 이미지, Default prompt, 토큰 수 증대: 512)
- 코드(옵션) 수정사항: max_new_tokens 수 512 (default=128)
- 결과: ["This image is a promotional advertisement for an online wholesale platform. The text is in Korean and provides information about the platform's services and policies. Here is a detailed description:\n\n### Advertisement Text\n\n**Title:**\n일양약품 온라인 공식판매처\n\n**Description:**\n본 제품은 일양약품과 정식 OEM 계약을 하고 적법한 절차에 따른 심사를 통해 본사가 독점으로 운영하는 상품입니다.\n\n**Additional Information:**\n본 제품의 저작권은
- 주씨엔에스헬스케어에게 있으며 따라서 제품의 상표권, 상세페이지, 촬영 이미지 문구 등 모든 콘텐츠는 저작권법의 보호를 받으며 무단 복제, 도용, 배포 시 민·형사상의 불이익을 받을 수 있습니다.\n\n**Related Laws:**\n- [권련법규]\n-
- 상표법 제58(손실보장청구권), 제109조(손해배상의 청구), 제89조(상품의 효력), 제95조(전용사용권) 등\n\n**Caution:**\n재판매 의심 주문 임의 취소 안내\n\n**Additional Information:**\n소비자를 가장해 상품을 구매한 후 재판매하는 경
- 우 주문이 자동으로 취소 될 수 있습니다.\n\n**Additional Note:**\n※온라인 공식 판매처 인증이 없고 불법 재판매하는 사업자를 통해 구매하신 상품은 품질보증, 제품안내, 배송 및 교환, 환불 등 고객지원이 불가능하니 참고 부탁드립니다.\n\n### Analysis\n\nThe advertisement is promoting an online wholesale platform for pharmaceutical products. It emphasizes the platform's official status and the fact that the products are under the exclusive control of the company. The platform also mentions that the products have been registered under the trademark law and that unauthorized reproduction, use, or distribution of the content is prohibited.\n\nThe text also includes a cautionary note about the possibility of the platform's services being terminated if the customer makes a purchase and then sells the product again.\n\nThe advertisement is designed to reassure customers about the platform's official status
- and the protection of their intellectual property rights. It also highlights the platform's commitment to customer support and the potential consequences of unauthorized sales"]
- 소요시간: 6분
- 결과 분석: 데이터를 빠지지 않고 받을 수 있으나, 부가적인 해석이 들어가 있으며, 소요시간이 늘어남. 긴 이미지에 대한 분리 처리 필요.