You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

__init__.py 923 B

1234567891011121314151617181920
  1. from kamal.transferability.trans_graph import TransferabilityGraph
  2. from kamal.transferability.trans_metric import AttrMapMetric
  3. import kamal
  4. from kamal.vision import sync_transforms as sT
  5. import os
  6. import torch
  7. from PIL import Image
  8. if __name__=='__main__':
  9. zoo = '/tmp/pycharm_project_225/kamal/transferability/model2'
  10. TG = TransferabilityGraph(zoo)
  11. probe_set_root = '/tmp/pycharm_project_225/kamal/transferability/probe_data'
  12. for probe_set in os.listdir( probe_set_root ):
  13. print("Add %s"%(probe_set))
  14. imgs_set = list( os.listdir( os.path.join( probe_set_root, probe_set ) ) )
  15. images = [ Image.open( os.path.join(probe_set_root, probe_set, img) ) for img in imgs_set ]
  16. metric = AttrMapMetric(images, device=torch.device('cuda'))
  17. TG.add_metric( probe_set, metric)
  18. TG.export_to_json(probe_set, 'exported_metrics/%s.json'%(probe_set), topk=3, normalize=True)

一站式算法开发平台、高性能分布式深度学习框架、先进算法模型库、视觉模型炼知平台、数据可视化分析平台等一系列平台及工具,在模型高效分布式训练、数据处理和可视分析、模型炼知和轻量化等技术上形成独特优势,目前已在产学研等各领域近千家单位及个人提供AI应用赋能