----- Python image to weight (imagededup)

Installation Library:

pip install imagededup

Installation issues you may encounter Reference:

Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

https://www.cnblogs.com/xiaodai0/p/11646512.html

ipython 6.5.0 has requirement prompt-toolkit<2.0.0,>=1.0.15, but you'll have prompt-toolkit 2.0.15 which is incompatible.

https://www.cnblogs.com/xiaodai0/p/11646462.html

code show as below:

from imagededup.methods Import phash 
phasher = phash () 

IF  the __name__ == ' __main__ ' :
     # generating an image directory of all the binary image to be encoded hash 
    Encodings = phasher.encode_images (R & lt image_dir = ' F.: \ TEMP \ temp_1010 \ JPEGImages ' ) 

    # of encoded image find duplicate image 
    Duplicates = phasher.find_duplicates (encoding_map = Encodings)
     Print ( ' = ' * 20 is )
     Print (Duplicates)
     Print (type (Duplicates))
     Print ( '= ' * 20 ) 

    # Given an image, an image display repeated thereto 
    from imagededup.utils Import plot_duplicates 
    plot_duplicates (image_dir = R & lt ' F.: \ TEMP \ temp_1010 \ JPEGImages ' , 
                    duplicate_map = Duplicates, 
                    filename = ' 0000128.jpg ' )

The results show the following:

 

 

 Reference may encounter problems running:

An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

https://www.cnblogs.com/xiaodai0/p/11646573.html

 

 

 

Original Reference: https: //mp.weixin.qq.com/s/GajGHkkG-f4xthXWJbkKbg

Guess you like

Origin www.cnblogs.com/xiaodai0/p/11646646.html