lightly-studio 0.4.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (356) hide show
  1. lightly_studio/__init__.py +12 -0
  2. lightly_studio/api/__init__.py +0 -0
  3. lightly_studio/api/app.py +131 -0
  4. lightly_studio/api/cache.py +77 -0
  5. lightly_studio/api/db_tables.py +35 -0
  6. lightly_studio/api/features.py +5 -0
  7. lightly_studio/api/routes/api/annotation.py +305 -0
  8. lightly_studio/api/routes/api/annotation_label.py +87 -0
  9. lightly_studio/api/routes/api/annotations/__init__.py +7 -0
  10. lightly_studio/api/routes/api/annotations/create_annotation.py +52 -0
  11. lightly_studio/api/routes/api/caption.py +100 -0
  12. lightly_studio/api/routes/api/classifier.py +384 -0
  13. lightly_studio/api/routes/api/dataset.py +191 -0
  14. lightly_studio/api/routes/api/dataset_tag.py +266 -0
  15. lightly_studio/api/routes/api/embeddings2d.py +90 -0
  16. lightly_studio/api/routes/api/exceptions.py +114 -0
  17. lightly_studio/api/routes/api/export.py +114 -0
  18. lightly_studio/api/routes/api/features.py +17 -0
  19. lightly_studio/api/routes/api/frame.py +241 -0
  20. lightly_studio/api/routes/api/image.py +155 -0
  21. lightly_studio/api/routes/api/metadata.py +161 -0
  22. lightly_studio/api/routes/api/operator.py +75 -0
  23. lightly_studio/api/routes/api/sample.py +103 -0
  24. lightly_studio/api/routes/api/selection.py +87 -0
  25. lightly_studio/api/routes/api/settings.py +41 -0
  26. lightly_studio/api/routes/api/status.py +19 -0
  27. lightly_studio/api/routes/api/text_embedding.py +50 -0
  28. lightly_studio/api/routes/api/validators.py +17 -0
  29. lightly_studio/api/routes/api/video.py +133 -0
  30. lightly_studio/api/routes/healthz.py +13 -0
  31. lightly_studio/api/routes/images.py +104 -0
  32. lightly_studio/api/routes/video_frames_media.py +116 -0
  33. lightly_studio/api/routes/video_media.py +223 -0
  34. lightly_studio/api/routes/webapp.py +51 -0
  35. lightly_studio/api/server.py +94 -0
  36. lightly_studio/core/__init__.py +0 -0
  37. lightly_studio/core/add_samples.py +533 -0
  38. lightly_studio/core/add_videos.py +294 -0
  39. lightly_studio/core/dataset.py +780 -0
  40. lightly_studio/core/dataset_query/__init__.py +14 -0
  41. lightly_studio/core/dataset_query/boolean_expression.py +67 -0
  42. lightly_studio/core/dataset_query/dataset_query.py +317 -0
  43. lightly_studio/core/dataset_query/field.py +113 -0
  44. lightly_studio/core/dataset_query/field_expression.py +79 -0
  45. lightly_studio/core/dataset_query/match_expression.py +23 -0
  46. lightly_studio/core/dataset_query/order_by.py +79 -0
  47. lightly_studio/core/dataset_query/sample_field.py +37 -0
  48. lightly_studio/core/dataset_query/tags_expression.py +46 -0
  49. lightly_studio/core/image_sample.py +36 -0
  50. lightly_studio/core/loading_log.py +56 -0
  51. lightly_studio/core/sample.py +291 -0
  52. lightly_studio/core/start_gui.py +54 -0
  53. lightly_studio/core/video_sample.py +38 -0
  54. lightly_studio/dataset/__init__.py +0 -0
  55. lightly_studio/dataset/edge_embedding_generator.py +155 -0
  56. lightly_studio/dataset/embedding_generator.py +129 -0
  57. lightly_studio/dataset/embedding_manager.py +349 -0
  58. lightly_studio/dataset/env.py +20 -0
  59. lightly_studio/dataset/file_utils.py +49 -0
  60. lightly_studio/dataset/fsspec_lister.py +275 -0
  61. lightly_studio/dataset/mobileclip_embedding_generator.py +158 -0
  62. lightly_studio/dataset/perception_encoder_embedding_generator.py +260 -0
  63. lightly_studio/db_manager.py +166 -0
  64. lightly_studio/dist_lightly_studio_view_app/_app/env.js +1 -0
  65. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/0.GcXvs2l7.css +1 -0
  66. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/12.Dx6SXgAb.css +1 -0
  67. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/17.9X9_k6TP.css +1 -0
  68. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/18.BxiimdIO.css +1 -0
  69. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/2.CkOblLn7.css +1 -0
  70. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/ClassifierSamplesGrid.BJbCDlvs.css +1 -0
  71. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/LightlyLogo.BNjCIww-.png +0 -0
  72. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/OpenSans-Bold.DGvYQtcs.ttf +0 -0
  73. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/OpenSans-Italic-VariableFont_wdth_wght.B4AZ-wl6.ttf +0 -0
  74. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/OpenSans-Medium.DVUZMR_6.ttf +0 -0
  75. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/OpenSans-Regular.DxJTClRG.ttf +0 -0
  76. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/OpenSans-SemiBold.D3TTYgdB.ttf +0 -0
  77. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/OpenSans-VariableFont_wdth_wght.BZBpG5Iz.ttf +0 -0
  78. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/_layout.CefECEWA.css +1 -0
  79. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/_layout.D5tDcjY-.css +1 -0
  80. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/_page.9X9_k6TP.css +1 -0
  81. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/_page.BxiimdIO.css +1 -0
  82. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/_page.Dx6SXgAb.css +1 -0
  83. lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/transform._-1mPSEI.css +1 -0
  84. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/0dDyq72A.js +20 -0
  85. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/69_IOA4Y.js +1 -0
  86. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BK4An2kI.js +1 -0
  87. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BRmB-kJ9.js +1 -0
  88. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/B_1cpokE.js +1 -0
  89. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BiqpDEr0.js +1 -0
  90. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BpLiSKgx.js +1 -0
  91. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BscxbINH.js +39 -0
  92. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/C1FmrZbK.js +1 -0
  93. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/C80h3dJx.js +1 -0
  94. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/C8mfFM-u.js +2 -0
  95. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CGY1p9L4.js +517 -0
  96. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/COfLknXM.js +1 -0
  97. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CWj6FrbW.js +1 -0
  98. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CYgJF_JY.js +1 -0
  99. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CmLg0ys7.js +1 -0
  100. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CvGjimpO.js +1 -0
  101. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D3RDXHoj.js +39 -0
  102. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D4y7iiT3.js +1 -0
  103. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D9SC3jBb.js +1 -0
  104. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DCuAdx1Q.js +20 -0
  105. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DDBy-_jD.js +1 -0
  106. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DIeogL5L.js +1 -0
  107. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DL9a7v5o.js +1 -0
  108. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DSKECuqX.js +39 -0
  109. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D_FFv0Oe.js +1 -0
  110. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DiZ5o5vz.js +1 -0
  111. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DkbXUtyG.js +1 -0
  112. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DmK2hulV.js +1 -0
  113. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DqnHaLTj.js +1 -0
  114. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DtWZc_tl.js +1 -0
  115. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DuUalyFS.js +1 -0
  116. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DwIonDAZ.js +1 -0
  117. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Il-mSPmK.js +1 -0
  118. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/KNLP4aJU.js +1 -0
  119. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/KjYeVjkE.js +1 -0
  120. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/MErlcOXj.js +1 -0
  121. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/VRI4prUD.js +1 -0
  122. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/VYb2dkNs.js +1 -0
  123. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/VqWvU2yF.js +1 -0
  124. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/dHC3otuL.js +1 -0
  125. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/da7Oy_lO.js +1 -0
  126. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/eAy8rZzC.js +2 -0
  127. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/erjNR5MX.js +1 -0
  128. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/f1oG3eFE.js +1 -0
  129. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/rsLi1iKv.js +20 -0
  130. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/rwuuBP9f.js +1 -0
  131. lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/xGHZQ1pe.js +3 -0
  132. lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/app.DrTRUgT3.js +2 -0
  133. lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/start.BK5EOJl2.js +1 -0
  134. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/0.CIvTuljF.js +4 -0
  135. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/1.UBvSzxdA.js +1 -0
  136. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/10.CQ_tiLJa.js +1 -0
  137. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/11.KqkAcaxW.js +1 -0
  138. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/12.DoYsmxQc.js +1 -0
  139. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/13.571n2LZA.js +1 -0
  140. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/14.DGs689M-.js +1 -0
  141. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/15.CWG1ehzT.js +1 -0
  142. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/16.Dpq6jbSh.js +1 -0
  143. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/17.B5AZbHUU.js +1 -0
  144. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/18.CBga8cnq.js +1 -0
  145. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/2.D2HXgz-8.js +1090 -0
  146. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/3.f4HAg-y3.js +1 -0
  147. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/4.BKF4xuKQ.js +1 -0
  148. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/5.BAE0Pm_f.js +39 -0
  149. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/6.CouWWpzA.js +1 -0
  150. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/7.UBHT0ktp.js +1 -0
  151. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/8.FiYNElcc.js +1 -0
  152. lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/9.B3-UaT23.js +1 -0
  153. lightly_studio/dist_lightly_studio_view_app/_app/immutable/workers/clustering.worker-DKqeLtG0.js +2 -0
  154. lightly_studio/dist_lightly_studio_view_app/_app/immutable/workers/search.worker-vNSty3B0.js +1 -0
  155. lightly_studio/dist_lightly_studio_view_app/_app/version.json +1 -0
  156. lightly_studio/dist_lightly_studio_view_app/apple-touch-icon-precomposed.png +0 -0
  157. lightly_studio/dist_lightly_studio_view_app/apple-touch-icon.png +0 -0
  158. lightly_studio/dist_lightly_studio_view_app/favicon.png +0 -0
  159. lightly_studio/dist_lightly_studio_view_app/index.html +45 -0
  160. lightly_studio/errors.py +5 -0
  161. lightly_studio/examples/example.py +25 -0
  162. lightly_studio/examples/example_coco.py +27 -0
  163. lightly_studio/examples/example_coco_caption.py +29 -0
  164. lightly_studio/examples/example_metadata.py +369 -0
  165. lightly_studio/examples/example_operators.py +111 -0
  166. lightly_studio/examples/example_selection.py +28 -0
  167. lightly_studio/examples/example_split_work.py +48 -0
  168. lightly_studio/examples/example_video.py +22 -0
  169. lightly_studio/examples/example_video_annotations.py +157 -0
  170. lightly_studio/examples/example_yolo.py +22 -0
  171. lightly_studio/export/coco_captions.py +69 -0
  172. lightly_studio/export/export_dataset.py +104 -0
  173. lightly_studio/export/lightly_studio_label_input.py +120 -0
  174. lightly_studio/export_schema.py +18 -0
  175. lightly_studio/export_version.py +57 -0
  176. lightly_studio/few_shot_classifier/__init__.py +0 -0
  177. lightly_studio/few_shot_classifier/classifier.py +80 -0
  178. lightly_studio/few_shot_classifier/classifier_manager.py +644 -0
  179. lightly_studio/few_shot_classifier/random_forest_classifier.py +495 -0
  180. lightly_studio/metadata/complex_metadata.py +47 -0
  181. lightly_studio/metadata/compute_similarity.py +84 -0
  182. lightly_studio/metadata/compute_typicality.py +67 -0
  183. lightly_studio/metadata/gps_coordinate.py +41 -0
  184. lightly_studio/metadata/metadata_protocol.py +17 -0
  185. lightly_studio/models/__init__.py +1 -0
  186. lightly_studio/models/annotation/__init__.py +0 -0
  187. lightly_studio/models/annotation/annotation_base.py +303 -0
  188. lightly_studio/models/annotation/instance_segmentation.py +56 -0
  189. lightly_studio/models/annotation/links.py +17 -0
  190. lightly_studio/models/annotation/object_detection.py +47 -0
  191. lightly_studio/models/annotation/semantic_segmentation.py +44 -0
  192. lightly_studio/models/annotation_label.py +47 -0
  193. lightly_studio/models/caption.py +49 -0
  194. lightly_studio/models/classifier.py +20 -0
  195. lightly_studio/models/dataset.py +70 -0
  196. lightly_studio/models/embedding_model.py +30 -0
  197. lightly_studio/models/image.py +96 -0
  198. lightly_studio/models/metadata.py +208 -0
  199. lightly_studio/models/range.py +17 -0
  200. lightly_studio/models/sample.py +154 -0
  201. lightly_studio/models/sample_embedding.py +36 -0
  202. lightly_studio/models/settings.py +69 -0
  203. lightly_studio/models/tag.py +96 -0
  204. lightly_studio/models/two_dim_embedding.py +16 -0
  205. lightly_studio/models/video.py +161 -0
  206. lightly_studio/plugins/__init__.py +0 -0
  207. lightly_studio/plugins/base_operator.py +60 -0
  208. lightly_studio/plugins/operator_registry.py +47 -0
  209. lightly_studio/plugins/parameter.py +70 -0
  210. lightly_studio/py.typed +0 -0
  211. lightly_studio/resolvers/__init__.py +0 -0
  212. lightly_studio/resolvers/annotation_label_resolver/__init__.py +22 -0
  213. lightly_studio/resolvers/annotation_label_resolver/create.py +27 -0
  214. lightly_studio/resolvers/annotation_label_resolver/delete.py +28 -0
  215. lightly_studio/resolvers/annotation_label_resolver/get_all.py +37 -0
  216. lightly_studio/resolvers/annotation_label_resolver/get_by_id.py +24 -0
  217. lightly_studio/resolvers/annotation_label_resolver/get_by_ids.py +25 -0
  218. lightly_studio/resolvers/annotation_label_resolver/get_by_label_name.py +24 -0
  219. lightly_studio/resolvers/annotation_label_resolver/names_by_ids.py +25 -0
  220. lightly_studio/resolvers/annotation_label_resolver/update.py +38 -0
  221. lightly_studio/resolvers/annotation_resolver/__init__.py +40 -0
  222. lightly_studio/resolvers/annotation_resolver/count_annotations_by_dataset.py +129 -0
  223. lightly_studio/resolvers/annotation_resolver/create_many.py +124 -0
  224. lightly_studio/resolvers/annotation_resolver/delete_annotation.py +87 -0
  225. lightly_studio/resolvers/annotation_resolver/delete_annotations.py +60 -0
  226. lightly_studio/resolvers/annotation_resolver/get_all.py +85 -0
  227. lightly_studio/resolvers/annotation_resolver/get_all_with_payload.py +179 -0
  228. lightly_studio/resolvers/annotation_resolver/get_by_id.py +34 -0
  229. lightly_studio/resolvers/annotation_resolver/get_by_id_with_payload.py +130 -0
  230. lightly_studio/resolvers/annotation_resolver/update_annotation_label.py +142 -0
  231. lightly_studio/resolvers/annotation_resolver/update_bounding_box.py +68 -0
  232. lightly_studio/resolvers/annotations/__init__.py +1 -0
  233. lightly_studio/resolvers/annotations/annotations_filter.py +88 -0
  234. lightly_studio/resolvers/caption_resolver.py +129 -0
  235. lightly_studio/resolvers/dataset_resolver/__init__.py +55 -0
  236. lightly_studio/resolvers/dataset_resolver/check_dataset_type.py +29 -0
  237. lightly_studio/resolvers/dataset_resolver/create.py +20 -0
  238. lightly_studio/resolvers/dataset_resolver/delete.py +20 -0
  239. lightly_studio/resolvers/dataset_resolver/export.py +267 -0
  240. lightly_studio/resolvers/dataset_resolver/get_all.py +19 -0
  241. lightly_studio/resolvers/dataset_resolver/get_by_id.py +16 -0
  242. lightly_studio/resolvers/dataset_resolver/get_by_name.py +12 -0
  243. lightly_studio/resolvers/dataset_resolver/get_dataset_details.py +27 -0
  244. lightly_studio/resolvers/dataset_resolver/get_hierarchy.py +31 -0
  245. lightly_studio/resolvers/dataset_resolver/get_or_create_child_dataset.py +58 -0
  246. lightly_studio/resolvers/dataset_resolver/get_parent_dataset_by_sample_id.py +27 -0
  247. lightly_studio/resolvers/dataset_resolver/get_parent_dataset_id.py +22 -0
  248. lightly_studio/resolvers/dataset_resolver/get_root_dataset.py +61 -0
  249. lightly_studio/resolvers/dataset_resolver/get_root_datasets_overview.py +41 -0
  250. lightly_studio/resolvers/dataset_resolver/update.py +25 -0
  251. lightly_studio/resolvers/embedding_model_resolver.py +120 -0
  252. lightly_studio/resolvers/image_filter.py +50 -0
  253. lightly_studio/resolvers/image_resolver/__init__.py +21 -0
  254. lightly_studio/resolvers/image_resolver/create_many.py +52 -0
  255. lightly_studio/resolvers/image_resolver/delete.py +20 -0
  256. lightly_studio/resolvers/image_resolver/filter_new_paths.py +23 -0
  257. lightly_studio/resolvers/image_resolver/get_all_by_dataset_id.py +117 -0
  258. lightly_studio/resolvers/image_resolver/get_by_id.py +14 -0
  259. lightly_studio/resolvers/image_resolver/get_dimension_bounds.py +75 -0
  260. lightly_studio/resolvers/image_resolver/get_many_by_id.py +22 -0
  261. lightly_studio/resolvers/image_resolver/get_samples_excluding.py +43 -0
  262. lightly_studio/resolvers/metadata_resolver/__init__.py +15 -0
  263. lightly_studio/resolvers/metadata_resolver/metadata_filter.py +163 -0
  264. lightly_studio/resolvers/metadata_resolver/sample/__init__.py +21 -0
  265. lightly_studio/resolvers/metadata_resolver/sample/bulk_update_metadata.py +46 -0
  266. lightly_studio/resolvers/metadata_resolver/sample/get_by_sample_id.py +24 -0
  267. lightly_studio/resolvers/metadata_resolver/sample/get_metadata_info.py +104 -0
  268. lightly_studio/resolvers/metadata_resolver/sample/get_value_for_sample.py +27 -0
  269. lightly_studio/resolvers/metadata_resolver/sample/set_value_for_sample.py +53 -0
  270. lightly_studio/resolvers/sample_embedding_resolver.py +132 -0
  271. lightly_studio/resolvers/sample_resolver/__init__.py +17 -0
  272. lightly_studio/resolvers/sample_resolver/count_by_dataset_id.py +16 -0
  273. lightly_studio/resolvers/sample_resolver/create.py +16 -0
  274. lightly_studio/resolvers/sample_resolver/create_many.py +25 -0
  275. lightly_studio/resolvers/sample_resolver/get_by_id.py +14 -0
  276. lightly_studio/resolvers/sample_resolver/get_filtered_samples.py +56 -0
  277. lightly_studio/resolvers/sample_resolver/get_many_by_id.py +22 -0
  278. lightly_studio/resolvers/sample_resolver/sample_filter.py +74 -0
  279. lightly_studio/resolvers/settings_resolver.py +62 -0
  280. lightly_studio/resolvers/tag_resolver.py +299 -0
  281. lightly_studio/resolvers/twodim_embedding_resolver.py +119 -0
  282. lightly_studio/resolvers/video_frame_resolver/__init__.py +23 -0
  283. lightly_studio/resolvers/video_frame_resolver/count_video_frames_annotations.py +83 -0
  284. lightly_studio/resolvers/video_frame_resolver/create_many.py +57 -0
  285. lightly_studio/resolvers/video_frame_resolver/get_all_by_dataset_id.py +63 -0
  286. lightly_studio/resolvers/video_frame_resolver/get_by_id.py +13 -0
  287. lightly_studio/resolvers/video_frame_resolver/get_table_fields_bounds.py +44 -0
  288. lightly_studio/resolvers/video_frame_resolver/video_frame_annotations_counter_filter.py +47 -0
  289. lightly_studio/resolvers/video_frame_resolver/video_frame_filter.py +57 -0
  290. lightly_studio/resolvers/video_resolver/__init__.py +27 -0
  291. lightly_studio/resolvers/video_resolver/count_video_frame_annotations_by_video_dataset.py +86 -0
  292. lightly_studio/resolvers/video_resolver/create_many.py +58 -0
  293. lightly_studio/resolvers/video_resolver/filter_new_paths.py +33 -0
  294. lightly_studio/resolvers/video_resolver/get_all_by_dataset_id.py +181 -0
  295. lightly_studio/resolvers/video_resolver/get_by_id.py +22 -0
  296. lightly_studio/resolvers/video_resolver/get_table_fields_bounds.py +72 -0
  297. lightly_studio/resolvers/video_resolver/get_view_by_id.py +52 -0
  298. lightly_studio/resolvers/video_resolver/video_count_annotations_filter.py +50 -0
  299. lightly_studio/resolvers/video_resolver/video_filter.py +98 -0
  300. lightly_studio/selection/__init__.py +1 -0
  301. lightly_studio/selection/mundig.py +143 -0
  302. lightly_studio/selection/select.py +203 -0
  303. lightly_studio/selection/select_via_db.py +273 -0
  304. lightly_studio/selection/selection_config.py +49 -0
  305. lightly_studio/services/annotations_service/__init__.py +33 -0
  306. lightly_studio/services/annotations_service/create_annotation.py +64 -0
  307. lightly_studio/services/annotations_service/delete_annotation.py +22 -0
  308. lightly_studio/services/annotations_service/get_annotation_by_id.py +31 -0
  309. lightly_studio/services/annotations_service/update_annotation.py +54 -0
  310. lightly_studio/services/annotations_service/update_annotation_bounding_box.py +36 -0
  311. lightly_studio/services/annotations_service/update_annotation_label.py +48 -0
  312. lightly_studio/services/annotations_service/update_annotations.py +29 -0
  313. lightly_studio/setup_logging.py +59 -0
  314. lightly_studio/type_definitions.py +31 -0
  315. lightly_studio/utils/__init__.py +3 -0
  316. lightly_studio/utils/download.py +94 -0
  317. lightly_studio/vendor/__init__.py +1 -0
  318. lightly_studio/vendor/mobileclip/ACKNOWLEDGEMENTS +422 -0
  319. lightly_studio/vendor/mobileclip/LICENSE +31 -0
  320. lightly_studio/vendor/mobileclip/LICENSE_weights_data +50 -0
  321. lightly_studio/vendor/mobileclip/README.md +5 -0
  322. lightly_studio/vendor/mobileclip/__init__.py +96 -0
  323. lightly_studio/vendor/mobileclip/clip.py +77 -0
  324. lightly_studio/vendor/mobileclip/configs/mobileclip_b.json +18 -0
  325. lightly_studio/vendor/mobileclip/configs/mobileclip_s0.json +18 -0
  326. lightly_studio/vendor/mobileclip/configs/mobileclip_s1.json +18 -0
  327. lightly_studio/vendor/mobileclip/configs/mobileclip_s2.json +18 -0
  328. lightly_studio/vendor/mobileclip/image_encoder.py +67 -0
  329. lightly_studio/vendor/mobileclip/logger.py +154 -0
  330. lightly_studio/vendor/mobileclip/models/__init__.py +10 -0
  331. lightly_studio/vendor/mobileclip/models/mci.py +933 -0
  332. lightly_studio/vendor/mobileclip/models/vit.py +433 -0
  333. lightly_studio/vendor/mobileclip/modules/__init__.py +4 -0
  334. lightly_studio/vendor/mobileclip/modules/common/__init__.py +4 -0
  335. lightly_studio/vendor/mobileclip/modules/common/mobileone.py +341 -0
  336. lightly_studio/vendor/mobileclip/modules/common/transformer.py +451 -0
  337. lightly_studio/vendor/mobileclip/modules/image/__init__.py +4 -0
  338. lightly_studio/vendor/mobileclip/modules/image/image_projection.py +113 -0
  339. lightly_studio/vendor/mobileclip/modules/image/replknet.py +188 -0
  340. lightly_studio/vendor/mobileclip/modules/text/__init__.py +4 -0
  341. lightly_studio/vendor/mobileclip/modules/text/repmixer.py +281 -0
  342. lightly_studio/vendor/mobileclip/modules/text/tokenizer.py +38 -0
  343. lightly_studio/vendor/mobileclip/text_encoder.py +245 -0
  344. lightly_studio/vendor/perception_encoder/LICENSE.PE +201 -0
  345. lightly_studio/vendor/perception_encoder/README.md +11 -0
  346. lightly_studio/vendor/perception_encoder/vision_encoder/__init__.py +0 -0
  347. lightly_studio/vendor/perception_encoder/vision_encoder/bpe_simple_vocab_16e6.txt.gz +0 -0
  348. lightly_studio/vendor/perception_encoder/vision_encoder/config.py +205 -0
  349. lightly_studio/vendor/perception_encoder/vision_encoder/config_src.py +264 -0
  350. lightly_studio/vendor/perception_encoder/vision_encoder/pe.py +766 -0
  351. lightly_studio/vendor/perception_encoder/vision_encoder/rope.py +352 -0
  352. lightly_studio/vendor/perception_encoder/vision_encoder/tokenizer.py +347 -0
  353. lightly_studio/vendor/perception_encoder/vision_encoder/transforms.py +36 -0
  354. lightly_studio-0.4.6.dist-info/METADATA +88 -0
  355. lightly_studio-0.4.6.dist-info/RECORD +356 -0
  356. lightly_studio-0.4.6.dist-info/WHEEL +4 -0
@@ -0,0 +1,59 @@
1
+ """Setup logging for the project.
2
+
3
+ Assumed to be called before any other module is imported. Make sure no internal
4
+ modules are called from this file.
5
+
6
+ Note: In python, module content is loaded only once. Therefore we can safely
7
+ put the logic in the global scope.
8
+ """
9
+
10
+ import logging
11
+ import warnings
12
+ from typing import ClassVar
13
+
14
+
15
+ class ConsoleFormatter(logging.Formatter):
16
+ """Customer console formatter for Lightly Studio."""
17
+
18
+ green = "\x1b[33;32m"
19
+ yellow = "\x1b[33;20m"
20
+ red = "\x1b[31;20m"
21
+ bold_red = "\x1b[31;1m"
22
+ reset = "\x1b[0m"
23
+ time_str = "%(asctime)s "
24
+ level_str = "%(levelname)s" + reset + ": "
25
+ msg_str = "%(message)s"
26
+
27
+ FORMATS: ClassVar = {
28
+ logging.DEBUG: time_str + level_str + msg_str,
29
+ logging.INFO: time_str + green + level_str + msg_str,
30
+ logging.WARNING: time_str + yellow + level_str + msg_str,
31
+ logging.ERROR: time_str + red + level_str + msg_str,
32
+ logging.CRITICAL: time_str + bold_red + level_str + msg_str,
33
+ }
34
+
35
+ def format(self, record: logging.LogRecord) -> str:
36
+ """Format record using our own format and colors."""
37
+ log_fmt = self.FORMATS.get(record.levelno)
38
+ formatter = logging.Formatter(log_fmt)
39
+ return formatter.format(record)
40
+
41
+
42
+ # Set logging level to ERROR for labelformat.
43
+ logging.getLogger("labelformat").setLevel(logging.ERROR)
44
+
45
+ # Configure the root logger with ConsoleFormatter
46
+ root_logger = logging.getLogger()
47
+ # Do not add a new logging handler if there's one registered already. This prevents duplicated
48
+ # log messages.
49
+ if not root_logger.handlers:
50
+ ch = logging.StreamHandler()
51
+ ch.setLevel(logging.INFO) # TODO(lukas 12/2025): Make this configurable
52
+ ch.setFormatter(ConsoleFormatter())
53
+ root_logger.addHandler(ch)
54
+ root_logger.setLevel(logging.INFO) # TODO(lukas 12/2025): Make this configurable
55
+
56
+ # Suppress warnings from mobileclip.
57
+ # TODO(Michal, 04/2025): Remove once we don't vendor mobileclip.
58
+ warnings.filterwarnings("ignore", category=FutureWarning, module="timm.models.layers")
59
+ warnings.filterwarnings("ignore", category=FutureWarning, module="mobileclip")
@@ -0,0 +1,31 @@
1
+ """Common type definitions for the lightly_studio package."""
2
+
3
+ from pathlib import Path
4
+ from typing import Any, Tuple, TypeVar, Union
5
+ from uuid import UUID
6
+
7
+ from sqlmodel.sql.expression import Select, SelectOfScalar
8
+
9
+ from lightly_studio.models.annotation.annotation_base import AnnotationBaseTable
10
+ from lightly_studio.models.image import ImageTable
11
+ from lightly_studio.models.sample import SampleTable
12
+ from lightly_studio.models.sample_embedding import SampleEmbeddingTable
13
+ from lightly_studio.models.video import VideoFrameTable, VideoTable
14
+
15
+ # Generic query type for filters that work with both data queries and count queries
16
+ QueryType = TypeVar(
17
+ "QueryType",
18
+ SelectOfScalar[AnnotationBaseTable],
19
+ SelectOfScalar[ImageTable],
20
+ SelectOfScalar[int],
21
+ SelectOfScalar[UUID],
22
+ SelectOfScalar[SampleTable],
23
+ SelectOfScalar[SampleEmbeddingTable],
24
+ Select[Tuple[VideoTable, VideoFrameTable]],
25
+ SelectOfScalar[VideoFrameTable],
26
+ Select[Tuple[Any, int]],
27
+ Select[Tuple[UUID, int]],
28
+ Select[Tuple[AnnotationBaseTable, Any]],
29
+ )
30
+
31
+ PathLike = Union[str, Path]
@@ -0,0 +1,3 @@
1
+ from .download import download_example_dataset
2
+
3
+ __all__ = ["download_example_dataset"]
@@ -0,0 +1,94 @@
1
+ """Module for downloading example datasets from the web."""
2
+
3
+ import logging
4
+ import os
5
+ import shutil
6
+ import zipfile
7
+ from pathlib import Path
8
+
9
+ import requests
10
+ from tqdm import tqdm
11
+
12
+ from lightly_studio.type_definitions import PathLike
13
+
14
+ logger = logging.getLogger(__name__)
15
+
16
+ # URL to download the main branch of the repo as a zip
17
+ ZIP_URL = "https://github.com/lightly-ai/dataset_examples/archive/refs/heads/main.zip"
18
+ # name of the folder inside the zip
19
+ REPO_DIR_IN_ZIP = "dataset_examples-main"
20
+
21
+
22
+ def download_example_dataset(
23
+ download_dir: PathLike = "dataset_examples", force_redownload: bool = False
24
+ ) -> str:
25
+ """Downloads the lightly-ai/dataset_examples repository from GitHub.
26
+
27
+ Args:
28
+ download_dir:
29
+ The directory where the dataset will be saved.
30
+ force_redownload:
31
+ If True, will download and overwrite existing data.
32
+ If False, will skip download if target_dir exists.
33
+
34
+ Returns:
35
+ The path to the downloaded dataset directory.
36
+ """
37
+ # Convert the user-provided path to an absolute, standard path.
38
+ # This handles '~' (home) and relative paths (../).
39
+ target_path = Path(download_dir).expanduser().resolve()
40
+ zip_path = target_path.with_name(f"{target_path.name}.zip")
41
+ temp_extract_dir = target_path.with_name(f"{target_path.name}_temp_extract")
42
+
43
+ # Check if data already exists.
44
+ if target_path.exists():
45
+ if not force_redownload:
46
+ logger.info(
47
+ f"'{target_path}' already exists. Skipping download. "
48
+ "Use force_redownload=True to re-download."
49
+ )
50
+ return str(target_path)
51
+ logger.info(f"'{target_path}' exists. Forcing re-download...")
52
+
53
+ logger.info(f"Downloading example dataset from GitHub to '{target_path}'...")
54
+
55
+ # Ensure parent folders exist.
56
+ target_path.parent.mkdir(parents=True, exist_ok=True)
57
+
58
+ try:
59
+ with requests.get(url=ZIP_URL, stream=True, timeout=30) as response:
60
+ response.raise_for_status()
61
+
62
+ total_size = int(response.headers.get("content-length", 0))
63
+
64
+ with open(file=zip_path, mode="wb") as f, tqdm(
65
+ desc=f"Downloading {zip_path}",
66
+ total=total_size,
67
+ unit="iB",
68
+ unit_scale=True,
69
+ unit_divisor=1024,
70
+ ) as bar:
71
+ for chunk in response.iter_content(chunk_size=1024):
72
+ size = f.write(chunk)
73
+ bar.update(n=size)
74
+
75
+ logger.info(f"Extracting '{zip_path}'...")
76
+ with zipfile.ZipFile(file=zip_path, mode="r") as z:
77
+ z.extractall(path=temp_extract_dir)
78
+
79
+ # Delete the old data only after*the new data is fully downloaded and extracted.
80
+ if target_path.exists():
81
+ shutil.rmtree(path=target_path)
82
+
83
+ # Move the contents to the target directory.
84
+ shutil.move(src=str(temp_extract_dir / REPO_DIR_IN_ZIP), dst=str(target_path))
85
+ logger.info(f"Successfully downloaded and extracted to '{target_path}'")
86
+
87
+ finally:
88
+ # Clean up temporary files.
89
+ if zip_path.exists():
90
+ os.remove(path=zip_path)
91
+ if temp_extract_dir.exists():
92
+ shutil.rmtree(path=temp_extract_dir)
93
+
94
+ return str(target_path)
@@ -0,0 +1 @@
1
+ """Vendor directory for third-party code."""
@@ -0,0 +1,422 @@
1
+ Acknowledgements
2
+ Portions of this Software may utilize the following copyrighted
3
+ material, the use of which is hereby acknowledged.
4
+
5
+ ------------------------------------------------
6
+ OpenCLIP (open_clip)
7
+
8
+ Copyright (c) 2012-2021 Gabriel Ilharco, Mitchell Wortsman,
9
+ Nicholas Carlini, Rohan Taori, Achal Dave, Vaishaal Shankar,
10
+ John Miller, Hongseok Namkoong, Hannaneh Hajishirzi, Ali Farhadi,
11
+ Ludwig Schmidt
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining
14
+ a copy of this software and associated documentation files (the
15
+ "Software"), to deal in the Software without restriction, including
16
+ without limitation the rights to use, copy, modify, merge, publish,
17
+ distribute, sublicense, and/or sell copies of the Software, and to
18
+ permit persons to whom the Software is furnished to do so, subject to
19
+ the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be
22
+ included in all copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31
+
32
+ ------------------------------------------------
33
+ DataComp (datacomp)
34
+
35
+ MIT License
36
+
37
+ Copyright (c) 2023 Samir Yitzhak Gadre, Gabriel Ilharco, Alex Fang,
38
+ Jonathan Hayase, Georgios Smyrnis, Thao Nguyen, Ryan Marten, Mitchell Wortsman,
39
+ Dhruba Ghosh, Jieyu Zhang, Eyal Orgad, Rahim Entezari, Giannis Daras,
40
+ Sarah Pratt, Vivek Ramanujan, Yonatan Bitton, Kalyani Marathe, Stephen Mussmann,
41
+ Richard Vencu, Mehdi Cherti, Ranjay Krishna, Pang Wei Koh, Olga Saukh,
42
+ Alexander Ratner, Shuran Song, Hannaneh Hajishirzi, Ali Farhadi,
43
+ Romain Beaumont, Sewoong Oh, Alex Dimakis, Jenia Jitsev,
44
+ Yair Carmon, Vaishaal Shankar, Ludwig Schmidt
45
+
46
+ Permission is hereby granted, free of charge, to any person obtaining a copy
47
+ of this software and associated documentation files (the "Software"), to deal
48
+ in the Software without restriction, including without limitation the rights
49
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
50
+ copies of the Software, and to permit persons to whom the Software is
51
+ furnished to do so, subject to the following conditions:
52
+
53
+ The above copyright notice and this permission notice shall be included in all
54
+ copies or substantial portions of the Software.
55
+
56
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
57
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
58
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
59
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
60
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
61
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
62
+ SOFTWARE.
63
+
64
+ ------------------------------------------------
65
+ FastViT (ml-fastvit)
66
+
67
+ Copyright (C) 2023 Apple Inc. All Rights Reserved.
68
+
69
+ IMPORTANT: This Apple software is supplied to you by Apple
70
+ Inc. ("Apple") in consideration of your agreement to the following
71
+ terms, and your use, installation, modification or redistribution of
72
+ this Apple software constitutes acceptance of these terms. If you do
73
+ not agree with these terms, please do not use, install, modify or
74
+ redistribute this Apple software.
75
+
76
+ In consideration of your agreement to abide by the following terms, and
77
+ subject to these terms, Apple grants you a personal, non-exclusive
78
+ license, under Apple's copyrights in this original Apple software (the
79
+ "Apple Software"), to use, reproduce, modify and redistribute the Apple
80
+ Software, with or without modifications, in source and/or binary forms;
81
+ provided that if you redistribute the Apple Software in its entirety and
82
+ without modifications, you must retain this notice and the following
83
+ text and disclaimers in all such redistributions of the Apple Software.
84
+ Neither the name, trademarks, service marks or logos of Apple Inc. may
85
+ be used to endorse or promote products derived from the Apple Software
86
+ without specific prior written permission from Apple. Except as
87
+ expressly stated in this notice, no other rights or licenses, express or
88
+ implied, are granted by Apple herein, including but not limited to any
89
+ patent rights that may be infringed by your derivative works or by other
90
+ works in which the Apple Software may be incorporated.
91
+
92
+ The Apple Software is provided by Apple on an "AS IS" basis. APPLE
93
+ MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
94
+ THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
95
+ FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
96
+ OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
97
+
98
+ IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
99
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
100
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
101
+ INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
102
+ MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
103
+ AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
104
+ STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
105
+ POSSIBILITY OF SUCH DAMAGE.
106
+
107
+ ------------------------------------------------
108
+ RepLKNet-pytorch (RepLKNet-pytorch)
109
+
110
+ MIT License
111
+
112
+ Copyright (c) 2022 Xiaohan Ding
113
+
114
+ Permission is hereby granted, free of charge, to any person obtaining a copy
115
+ of this software and associated documentation files (the "Software"), to deal
116
+ in the Software without restriction, including without limitation the rights
117
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
118
+ copies of the Software, and to permit persons to whom the Software is
119
+ furnished to do so, subject to the following conditions:
120
+
121
+ The above copyright notice and this permission notice shall be included in all
122
+ copies or substantial portions of the Software.
123
+
124
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
125
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
126
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
127
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
128
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
129
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
130
+ SOFTWARE.
131
+
132
+ ------------------------------------------------
133
+ CVNets: A library for training computer vision networks (ml-cvnets)
134
+
135
+ Copyright (C) 2023 Apple Inc. All Rights Reserved.
136
+
137
+ Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
138
+ Inc. ("Apple") in consideration of your agreement to the following
139
+ terms, and your use, installation, modification or redistribution of
140
+ this Apple software constitutes acceptance of these terms. If you do
141
+ not agree with these terms, please do not use, install, modify or
142
+ redistribute this Apple software.
143
+
144
+ In consideration of your agreement to abide by the following terms, and
145
+ subject to these terms, Apple grants you a personal, non-exclusive
146
+ license, under Apple's copyrights in this original Apple software (the
147
+ "Apple Software"), to use, reproduce, modify and redistribute the Apple
148
+ Software, with or without modifications, in source and/or binary forms;
149
+ provided that if you redistribute the Apple Software in its entirety and
150
+ without modifications, you must retain this notice and the following
151
+ text and disclaimers in all such redistributions of the Apple Software.
152
+ Neither the name, trademarks, service marks or logos of Apple Inc. may
153
+ be used to endorse or promote products derived from the Apple Software
154
+ without specific prior written permission from Apple. Except as
155
+ expressly stated in this notice, no other rights or licenses, express or
156
+ implied, are granted by Apple herein, including but not limited to any
157
+ patent rights that may be infringed by your derivative works or by other
158
+ works in which the Apple Software may be incorporated.
159
+
160
+ The Apple Software is provided by Apple on an "AS IS" basis. APPLE
161
+ MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
162
+ THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
163
+ FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
164
+ OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
165
+
166
+ IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
167
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
168
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
169
+ INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
170
+ MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
171
+ AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
172
+ STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
173
+ POSSIBILITY OF SUCH DAMAGE.
174
+
175
+ ------------------------------------------------
176
+ PyTorch Image Models (timm)
177
+ Ross Wightman
178
+
179
+ Apache License
180
+ Version 2.0, January 2004
181
+ http://www.apache.org/licenses/
182
+
183
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
184
+
185
+ 1. Definitions.
186
+
187
+ "License" shall mean the terms and conditions for use, reproduction,
188
+ and distribution as defined by Sections 1 through 9 of this document.
189
+
190
+ "Licensor" shall mean the copyright owner or entity authorized by
191
+ the copyright owner that is granting the License.
192
+
193
+ "Legal Entity" shall mean the union of the acting entity and all
194
+ other entities that control, are controlled by, or are under common
195
+ control with that entity. For the purposes of this definition,
196
+ "control" means (i) the power, direct or indirect, to cause the
197
+ direction or management of such entity, whether by contract or
198
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
199
+ outstanding shares, or (iii) beneficial ownership of such entity.
200
+
201
+ "You" (or "Your") shall mean an individual or Legal Entity
202
+ exercising permissions granted by this License.
203
+
204
+ "Source" form shall mean the preferred form for making modifications,
205
+ including but not limited to software source code, documentation
206
+ source, and configuration files.
207
+
208
+ "Object" form shall mean any form resulting from mechanical
209
+ transformation or translation of a Source form, including but
210
+ not limited to compiled object code, generated documentation,
211
+ and conversions to other media types.
212
+
213
+ "Work" shall mean the work of authorship, whether in Source or
214
+ Object form, made available under the License, as indicated by a
215
+ copyright notice that is included in or attached to the work
216
+ (an example is provided in the Appendix below).
217
+
218
+ "Derivative Works" shall mean any work, whether in Source or Object
219
+ form, that is based on (or derived from) the Work and for which the
220
+ editorial revisions, annotations, elaborations, or other modifications
221
+ represent, as a whole, an original work of authorship. For the purposes
222
+ of this License, Derivative Works shall not include works that remain
223
+ separable from, or merely link (or bind by name) to the interfaces of,
224
+ the Work and Derivative Works thereof.
225
+
226
+ "Contribution" shall mean any work of authorship, including
227
+ the original version of the Work and any modifications or additions
228
+ to that Work or Derivative Works thereof, that is intentionally
229
+ submitted to Licensor for inclusion in the Work by the copyright owner
230
+ or by an individual or Legal Entity authorized to submit on behalf of
231
+ the copyright owner. For the purposes of this definition, "submitted"
232
+ means any form of electronic, verbal, or written communication sent
233
+ to the Licensor or its representatives, including but not limited to
234
+ communication on electronic mailing lists, source code control systems,
235
+ and issue tracking systems that are managed by, or on behalf of, the
236
+ Licensor for the purpose of discussing and improving the Work, but
237
+ excluding communication that is conspicuously marked or otherwise
238
+ designated in writing by the copyright owner as "Not a Contribution."
239
+
240
+ "Contributor" shall mean Licensor and any individual or Legal Entity
241
+ on behalf of whom a Contribution has been received by Licensor and
242
+ subsequently incorporated within the Work.
243
+
244
+ 2. Grant of Copyright License. Subject to the terms and conditions of
245
+ this License, each Contributor hereby grants to You a perpetual,
246
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
247
+ copyright license to reproduce, prepare Derivative Works of,
248
+ publicly display, publicly perform, sublicense, and distribute the
249
+ Work and such Derivative Works in Source or Object form.
250
+
251
+ 3. Grant of Patent License. Subject to the terms and conditions of
252
+ this License, each Contributor hereby grants to You a perpetual,
253
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
254
+ (except as stated in this section) patent license to make, have made,
255
+ use, offer to sell, sell, import, and otherwise transfer the Work,
256
+ where such license applies only to those patent claims licensable
257
+ by such Contributor that are necessarily infringed by their
258
+ Contribution(s) alone or by combination of their Contribution(s)
259
+ with the Work to which such Contribution(s) was submitted. If You
260
+ institute patent litigation against any entity (including a
261
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
262
+ or a Contribution incorporated within the Work constitutes direct
263
+ or contributory patent infringement, then any patent licenses
264
+ granted to You under this License for that Work shall terminate
265
+ as of the date such litigation is filed.
266
+
267
+ 4. Redistribution. You may reproduce and distribute copies of the
268
+ Work or Derivative Works thereof in any medium, with or without
269
+ modifications, and in Source or Object form, provided that You
270
+ meet the following conditions:
271
+
272
+ (a) You must give any other recipients of the Work or
273
+ Derivative Works a copy of this License; and
274
+
275
+ (b) You must cause any modified files to carry prominent notices
276
+ stating that You changed the files; and
277
+
278
+ (c) You must retain, in the Source form of any Derivative Works
279
+ that You distribute, all copyright, patent, trademark, and
280
+ attribution notices from the Source form of the Work,
281
+ excluding those notices that do not pertain to any part of
282
+ the Derivative Works; and
283
+
284
+ (d) If the Work includes a "NOTICE" text file as part of its
285
+ distribution, then any Derivative Works that You distribute must
286
+ include a readable copy of the attribution notices contained
287
+ within such NOTICE file, excluding those notices that do not
288
+ pertain to any part of the Derivative Works, in at least one
289
+ of the following places: within a NOTICE text file distributed
290
+ as part of the Derivative Works; within the Source form or
291
+ documentation, if provided along with the Derivative Works; or,
292
+ within a display generated by the Derivative Works, if and
293
+ wherever such third-party notices normally appear. The contents
294
+ of the NOTICE file are for informational purposes only and
295
+ do not modify the License. You may add Your own attribution
296
+ notices within Derivative Works that You distribute, alongside
297
+ or as an addendum to the NOTICE text from the Work, provided
298
+ that such additional attribution notices cannot be construed
299
+ as modifying the License.
300
+
301
+ You may add Your own copyright statement to Your modifications and
302
+ may provide additional or different license terms and conditions
303
+ for use, reproduction, or distribution of Your modifications, or
304
+ for any such Derivative Works as a whole, provided Your use,
305
+ reproduction, and distribution of the Work otherwise complies with
306
+ the conditions stated in this License.
307
+
308
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
309
+ any Contribution intentionally submitted for inclusion in the Work
310
+ by You to the Licensor shall be under the terms and conditions of
311
+ this License, without any additional terms or conditions.
312
+ Notwithstanding the above, nothing herein shall supersede or modify
313
+ the terms of any separate license agreement you may have executed
314
+ with Licensor regarding such Contributions.
315
+
316
+ 6. Trademarks. This License does not grant permission to use the trade
317
+ names, trademarks, service marks, or product names of the Licensor,
318
+ except as required for reasonable and customary use in describing the
319
+ origin of the Work and reproducing the content of the NOTICE file.
320
+
321
+ 7. Disclaimer of Warranty. Unless required by applicable law or
322
+ agreed to in writing, Licensor provides the Work (and each
323
+ Contributor provides its Contributions) on an "AS IS" BASIS,
324
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
325
+ implied, including, without limitation, any warranties or conditions
326
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
327
+ PARTICULAR PURPOSE. You are solely responsible for determining the
328
+ appropriateness of using or redistributing the Work and assume any
329
+ risks associated with Your exercise of permissions under this License.
330
+
331
+ 8. Limitation of Liability. In no event and under no legal theory,
332
+ whether in tort (including negligence), contract, or otherwise,
333
+ unless required by applicable law (such as deliberate and grossly
334
+ negligent acts) or agreed to in writing, shall any Contributor be
335
+ liable to You for damages, including any direct, indirect, special,
336
+ incidental, or consequential damages of any character arising as a
337
+ result of this License or out of the use or inability to use the
338
+ Work (including but not limited to damages for loss of goodwill,
339
+ work stoppage, computer failure or malfunction, or any and all
340
+ other commercial damages or losses), even if such Contributor
341
+ has been advised of the possibility of such damages.
342
+
343
+ 9. Accepting Warranty or Additional Liability. While redistributing
344
+ the Work or Derivative Works thereof, You may choose to offer,
345
+ and charge a fee for, acceptance of support, warranty, indemnity,
346
+ or other liability obligations and/or rights consistent with this
347
+ License. However, in accepting such obligations, You may act only
348
+ on Your own behalf and on Your sole responsibility, not on behalf
349
+ of any other Contributor, and only if You agree to indemnify,
350
+ defend, and hold each Contributor harmless for any liability
351
+ incurred by, or claims asserted against, such Contributor by reason
352
+ of your accepting any such warranty or additional liability.
353
+
354
+ END OF TERMS AND CONDITIONS
355
+
356
+ APPENDIX: How to apply the Apache License to your work.
357
+
358
+ To apply the Apache License to your work, attach the following
359
+ boilerplate notice, with the fields enclosed by brackets "{}"
360
+ replaced with your own identifying information. (Don't include
361
+ the brackets!) The text should be enclosed in the appropriate
362
+ comment syntax for the file format. We also recommend that a
363
+ file or class name and description of purpose be included on the
364
+ same "printed page" as the copyright notice for easier
365
+ identification within third-party archives.
366
+
367
+ Copyright 2019 Ross Wightman
368
+
369
+ Licensed under the Apache License, Version 2.0 (the "License");
370
+ you may not use this file except in compliance with the License.
371
+ You may obtain a copy of the License at
372
+
373
+ http://www.apache.org/licenses/LICENSE-2.0
374
+
375
+ Unless required by applicable law or agreed to in writing, software
376
+ distributed under the License is distributed on an "AS IS" BASIS,
377
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
378
+ See the License for the specific language governing permissions and
379
+ limitations under the License.
380
+
381
+ ------------------------------------------------
382
+ Dataset Reinforcement (ml-dr)
383
+
384
+ Copyright (C) 2022 Apple Inc. All Rights Reserved.
385
+
386
+ IMPORTANT: This Apple software is supplied to you by Apple
387
+ Inc. ("Apple") in consideration of your agreement to the following
388
+ terms, and your use, installation, modification or redistribution of
389
+ this Apple software constitutes acceptance of these terms. If you do
390
+ not agree with these terms, please do not use, install, modify or
391
+ redistribute this Apple software.
392
+
393
+ In consideration of your agreement to abide by the following terms, and
394
+ subject to these terms, Apple grants you a personal, non-exclusive
395
+ license, under Apple's copyrights in this original Apple software (the
396
+ "Apple Software"), to use, reproduce, modify and redistribute the Apple
397
+ Software, with or without modifications, in source and/or binary forms;
398
+ provided that if you redistribute the Apple Software in its entirety and
399
+ without modifications, you must retain this notice and the following
400
+ text and disclaimers in all such redistributions of the Apple Software.
401
+ Neither the name, trademarks, service marks or logos of Apple Inc. may
402
+ be used to endorse or promote products derived from the Apple Software
403
+ without specific prior written permission from Apple. Except as
404
+ expressly stated in this notice, no other rights or licenses, express or
405
+ implied, are granted by Apple herein, including but not limited to any
406
+ patent rights that may be infringed by your derivative works or by other
407
+ works in which the Apple Software may be incorporated.
408
+
409
+ The Apple Software is provided by Apple on an "AS IS" basis. APPLE
410
+ MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
411
+ THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
412
+ FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
413
+ OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
414
+
415
+ IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
416
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
417
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
418
+ INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
419
+ MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
420
+ AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
421
+ STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
422
+ POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,31 @@
1
+ MIT License
2
+
3
+ Copyright © 2024 Apple Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ -------------------------------------------------------------------------------
24
+ SOFTWARE DISTRIBUTED WITH ML-MobileCLIP:
25
+
26
+ The ML-MobileCLIP model weights and data copyright and license terms can be
27
+ found in LICENSE_weights_data.
28
+
29
+ The ML-MobileCLIP software includes a number of subcomponents with separate
30
+ copyright notices and license terms - please see the file ACKNOWLEDGEMENTS.
31
+ -------------------------------------------------------------------------------