Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable remotecv to process ICO files #72

Merged
merged 1 commit into from
Feb 23, 2023
Merged

Conversation

RaphaelVRossi
Copy link
Member

When Remotecv process some ICO file, it will fail with this Opencv error:

EXCEPTION(most recent call first)
error: OpenCV(4.7.0) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

  File "pyres/worker.py", line 256, in process
    return job.perform()
  File "pyres/job.py", line 83, in perform
    return payload_class.perform(*args)
  File "remotecv/pyres_tasks.py", line 17, in perform
    points = cls.processor.detect(detection_type, image_data)
  File "remotecv/image_processor.py", line 29, in detect
    return self.run_detections(image, detector.split("+"))
  File "remotecv/image_processor.py", line 36, in run_detections
    points = self.detectors[detector].detect(image)
  File "remotecv/detectors/face_detector/__init__.py", line 24, in detect
    features = self.get_grayscale_equalized_features(image)
  File "remotecv/detectors/__init__.py", line 60, in get_grayscale_equalized_features
    img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

This PR will change the format from ICO to PNG, in order to avoid this error.

ICO to test:
https://raw.githubusercontent.com/thumbor/remotecv/enable-process-ico-files/tests/fixtures/one_face.ico

@codeclimate
Copy link

codeclimate bot commented Feb 16, 2023

Code Climate has analyzed commit ecd739b and detected 0 issues on this pull request.

View more on Code Climate.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4198464283

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 84.852%

Totals Coverage Status
Change from base Build 3883074110: 0.0%
Covered Lines: 414
Relevant Lines: 519

💛 - Coveralls

Copy link
Contributor

@devppjr devppjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@guilhermef guilhermef merged commit 96d6dce into master Feb 23, 2023
@guilhermef guilhermef deleted the enable-process-ico-files branch February 23, 2023 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants