CoolFace
Modelpublic

Library-Mutsumi/ccip

sourceHugging Faceopenrailupdated 4mo agoView on Hugging Face
0likes
Model Card

CCIP

CCIP(Contrastive Anime Character Image Pre-Training) is a model to calculuate the visual similarity between anime characters in two images. (limited to images containing only a single anime character). More similar the characters between two images are, higher score it should have.

Usage

Using CCIP with imgutils

Calculuate character similarity between images:

from imgutils.metrics import ccip_batch_differences

ccip_batch_differences(['ccip/1.jpg', 'ccip/2.jpg', 'ccip/6.jpg', 'ccip/7.jpg'])
array([[6.5350548e-08, 1.6583106e-01, 4.2947042e-01, 4.0375218e-01],
       [1.6583106e-01, 9.8025822e-08, 4.3715334e-01, 4.0748104e-01],
       [4.2947042e-01, 4.3715334e-01, 3.2675274e-08, 3.9229470e-01],
       [4.0375218e-01, 4.0748104e-01, 3.9229470e-01, 6.5350548e-08]],
      dtype=float32)

More detailed instruction

Performence

ModelF1 ScorePrecisionRecallThresholdCluster_2Cluster_Free
ccip-caformer_b36-240.9409250.9382540.9436120.2132310.895080.957017
ccip-caformer-24-randaug-pruned0.9172110.9334810.9014990.1784750.8903660.922375
ccip-v2-caformer_s36-100.9064220.9327790.8815130.2077570.8745920.89241
ccip-caformer-6-randaug-pruned_fp320.8784030.8936480.8636690.1951220.8101760.897904
ccip-caformer-5_fp320.8643630.901550.8301210.1839730.7920510.862289
ccip-caformer-4_fp320.8449670.8705530.8208420.183670.7955650.868133
ccip-caformer_query-120.8239280.8711220.7815850.1413080.7872370.809426
ccip-caformer-23randaugfp320.816250.8541340.7815850.1367970.7456970.8068
ccip-caformer-2-randaug-pruned_fp320.785610.8001480.7715920.1710530.6866170.728195
ccip-caformer-2_fp320.7551250.7901720.7230550.1412750.649770.718516
  • —The calculation of F1 Score, Precision, and Recall considers "the characters in both images are the same" as a positive case. Threshold is determined by finding the maximum value on the F1 Score curve.
  • —Cluster_2 represents the approximate optimal clustering solution obtained by tuning the eps value in DBSCAN clustering algorithm with minsamples set to `2`, and evaluating the similarity between the obtained clusters and the true distribution using the `randomadjust_score`.
  • —Cluster_Free represents the approximate optimal solution obtained by tuning the max_eps and min_samples values in the OPTICS clustering algorithm, and evaluating the similarity between the obtained clusters and the true distribution using the random_adjust_score.

operations benchmark

Citation

bibtex
@misc{CCIP,
  title={Contrastive Anime Character Image Pre-Training},
  author={Ziyi Dong and narugo1992},
  year={2024},
  howpublished={\url{https://huggingface.co/deepghs/ccip}}
}