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

TimeOutError for multiple sketch maps of urban area #403

Open
Gigaszi opened this issue Mar 25, 2024 · 3 comments
Open

TimeOutError for multiple sketch maps of urban area #403

Gigaszi opened this issue Mar 25, 2024 · 3 comments
Labels
bug Something isn't working priority:high Should be addressed as soon as possible (next release)

Comments

@Gigaszi
Copy link
Contributor

Gigaszi commented Mar 25, 2024

When digitizing multiple (here 4) sketch maps of an urban error, this error occurs:

sketch-map-tool-celery-1  | 2024-03-25 12:40:20,361 - ERROR - request.py - on_failure - Task handler raised error: TimeLimitExceeded(900)
sketch-map-tool-celery-1  | Traceback (most recent call last):
sketch-map-tool-celery-1  |   File "/home/smt/.conda/envs/smt/lib/python3.11/site-packages/billiard/pool.py", line 683, in on_hard_timeout
sketch-map-tool-celery-1  |     raise TimeLimitExceeded(job._timeout)
sketch-map-tool-celery-1  | billiard.einfo.ExceptionWithTraceback: 
sketch-map-tool-celery-1  | """
sketch-map-tool-celery-1  | Traceback (most recent call last):
sketch-map-tool-celery-1  |   File "/home/smt/.conda/envs/smt/lib/python3.11/site-packages/billiard/pool.py", line 683, in on_hard_timeout
sketch-map-tool-celery-1  |     raise TimeLimitExceeded(job._timeout)
sketch-map-tool-celery-1  | billiard.exceptions.TimeLimitExceeded: TimeLimitExceeded(900,)
sketch-map-tool-celery-1  | """
sketch-map-tool-celery-1  | 2024-03-25 12:40:20,362 - ERROR - request.py - on_timeout - Hard time limit (900s) exceeded for sketch_map_tool.tasks.georeference_sketch_maps[52c7f63b-2814-4618-b7af-0b1b774897c5]
sketch-map-tool-celery-1  | 2024-03-25 12:40:20,672 - ERROR - request.py - on_failure - Task handler raised error: TimeLimitExceeded(900)
sketch-map-tool-celery-1  | Traceback (most recent call last):
sketch-map-tool-celery-1  |   File "/home/smt/.conda/envs/smt/lib/python3.11/site-packages/billiard/pool.py", line 683, in on_hard_timeout
sketch-map-tool-celery-1  |     raise TimeLimitExceeded(job._timeout)
sketch-map-tool-celery-1  | billiard.einfo.ExceptionWithTraceback: 
sketch-map-tool-celery-1  | """
sketch-map-tool-celery-1  | Traceback (most recent call last):
sketch-map-tool-celery-1  |   File "/home/smt/.conda/envs/smt/lib/python3.11/site-packages/billiard/pool.py", line 683, in on_hard_timeout
sketch-map-tool-celery-1  |     raise TimeLimitExceeded(job._timeout)
sketch-map-tool-celery-1  | billiard.exceptions.TimeLimitExceeded: TimeLimitExceeded(900,)
sketch-map-tool-celery-1  | """
sketch-map-tool-celery-1  | 2024-03-25 12:40:20,672 - ERROR - request.py - on_timeout - Hard time limit (900s) exceeded for sketch_map_tool.tasks.digitize_sketches[72263cf6-27ce-4f4a-80e8-255472114184]
sketch-map-tool-celery-1  | Process 'ForkPoolWorker-2' pid:28 exited with 'signal 9 (SIGKILL)'
sketch-map-tool-celery-1  | Process 'ForkPoolWorker-4' pid:30 exited with 'signal 9 (SIGKILL)'

Map Frame:
filename

Sketch Map:
13

@matthiasschaub matthiasschaub added the bug Something isn't working label Mar 26, 2024
@matthiasschaub
Copy link
Collaborator

Brisk is just able to find a ridiculus number of keypoints for this set of images. This leads naturaly to a longer processing time.

def limit_keypoints(keypoints: list, descriptors: NDArray, max_keypoints: int = 50000) -> tuple:
        """Limit the number of keypoints and descriptors """
        if len(keypoints) > max_keypoints:
            #randomly select max_keypoints
            indices = np.random.choice(len(keypoints), max_keypoints, replace=False)
            keypoints = [keypoints[i] for i in indices]
            descriptors = descriptors[indices]
            
        return keypoints, descriptors

kpts1, desc1 = limit_keypoints(kpts1, desc1)
kpts2, desc2 = limit_keypoints(kpts2, desc2)

(@itisacloud)

@matthiasschaub
Copy link
Collaborator

Other solutions could be to reduce the resolution of the input image (#421)

@solo2307
Copy link
Contributor

solo2307 commented Apr 11, 2024

@matthiasschaub and @itisacloud , you are both correct. Two suggested ways , the limitation of descriptors' number and reduction of image size, are ok with me. However, I would suggest to go to image resizing:

h, w,  _ = temp_img.shape # the default template size is (1587, 1867)
img_clipped = clip(cv2.resize(img_raw, (w, h)), temp_img)

@matthiasschaub matthiasschaub added the priority:high Should be addressed as soon as possible (next release) label Apr 15, 2024
matthiasschaub added a commit that referenced this issue Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:high Should be addressed as soon as possible (next release)
Projects
None yet
Development

No branches or pull requests

3 participants