keplerlab / katna

Tool for automating common video key-frame extraction, video compression and Image Auto-crop/Image-resize tasks
https://katna.readthedocs.io/
MIT License
313 stars 59 forks source link

Image Sorting #2

Closed saurabh986 closed 4 years ago

saurabh986 commented 4 years ago

Can you please help me for sorting the extracted images from video. The extracted Images are not in sequence as per video playback.

saurabh986 commented 4 years ago

Can you please help me for sorting the extracted images from video. The extracted Images are not in sequence as per video playback.

Finally got sorted result by Modifying the image_selector.py class Here I applied sorted(variance_laplacians) & sorted(filtered_items) which gave me results images in sequence.

HuitMahoon commented 3 years ago

Can you please help me for sorting the extracted images from video. The extracted Images are not in sequence as per video playback.

Finally got sorted result by Modifying the image_selector.py class Here I applied sorted(variance_laplacians) & sorted(filtered_items) which gave me results images in sequence.

after modifided iamge_selector.py class as you suggest, it doesn't seem to work. Could you give more detailed code change?

basakozsoy commented 3 years ago

@HuitMahoon, inside the image_selector.py class, I have sorted the return values, so: return sorted(variance_laplacians) and return sorted(filtered_items) The output images are in sequence.

HuitMahoon commented 3 years ago

@basakozsoy , After modified the return sorted(variance_laplacians)andreturn sorted(filtered_items), should I run "python setup.py install" to reinstall katna module?

basakozsoy commented 3 years ago

@HuitMahoon No, simply saving the changes on image_selector.py is enough. You can run your own code afterwards.

HuitMahoon commented 3 years ago

@basakozsoy , Thanks a lot, it finally works for me. The output images are in sequence. But I am still confused, the name of the output always just start from 0 to N, not the exact frame ID in the sequence. In some scenarios, we may want to know the exact location of the output. Could you give me some tips about how to solve it?

To this end, maybe we need to convert the variance_laplacians and filtered_items type to dict, and make some significant corresponding code changes

HuitMahoon commented 3 years ago

Finally, by making some code changes, I successfully fulfill this function which is to rename the output image file with its exact location in the sequences.