Closed kyakuno closed 1 year ago
Python
[[49406 320 2751 49407 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0]
[49406 320 1929 49407 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0]
[49406 320 2368 49407 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0]]
INFO clip.py (169) : Embedding 0 to 3
INFO clip.py (196) : chelsea.png
libpng warning: iCCP: known incorrect sRGB profile
INFO clip.py (203) : Start inference...
==============================================================
class_count=3
+ idx=0
category=2[a cat ]
prob=0.9848435521125793
+ idx=1
category=1[a dog ]
prob=0.01479444932192564
+ idx=2
category=0[a human ]
prob=0.00036194053245708346
INFO clip.py (226) : Script finished successfully.
PythonのPreprocess
Input
Output
C++
kyakuno@KazukinoMacBook-Pro clip % ./clip
env_id : 0 type : 0 name : CPU
env_id : 1 type : 1 name : CPU-AppleAccelerate
env_id : 2 type : 2 name : MPSDNN-Apple M1 Max
you can select environment using -e option
env_name: MPSDNN-Apple M1 Max
Input Text : a dog
Tokens : 49406 320 1929 49407 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Input Text : a cat
Tokens : 49406 320 2368 49407 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Input Text : a human
Tokens : 49406 320 2751 49407 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Text embedding
Image embedding
libpng warning: iCCP: known incorrect sRGB profile
input 451x300 output 300x300 ratio 2.013393x1.339286
features 512
input_img 150528 150528
a dog 0.013109
a cat 0.985716
a human 0.001175
Program finished successfully.
24