ImageCategory.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. using AIPlatform.Protocol.LabelItems;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel.DataAnnotations;
  5. namespace AIPlatform.Protocol.Entities
  6. {
  7. /// <summary>
  8. /// 分类层级
  9. /// </summary>
  10. public enum CategoryLevel
  11. {
  12. [Display(Name = "无")]
  13. None = -1,
  14. /// <summary>
  15. /// 组织
  16. /// </summary>
  17. [Display(Name = "组织")]
  18. Organization = 0,
  19. /// <summary>
  20. /// 图像大类,同步于标签模板
  21. /// </summary>
  22. [Display(Name = "大类")]
  23. MainCategory = 1,
  24. /// <summary>
  25. /// 图像批次
  26. /// </summary>
  27. [Display(Name = "批次")]
  28. Batch,
  29. /// <summary>
  30. /// 重复分配用例
  31. /// </summary>
  32. [Display(Name = "用例")]
  33. SameBatchLabelCase,
  34. }
  35. /// <summary>
  36. /// 人员类型
  37. /// </summary>
  38. public enum AccountType
  39. {
  40. None,
  41. /// <summary>
  42. /// 管理者
  43. /// </summary>
  44. Admin,
  45. /// <summary>
  46. /// 开发者
  47. /// </summary>
  48. Developer,
  49. /// <summary>
  50. /// 标注者
  51. /// </summary>
  52. Labeler,
  53. /// <summary>
  54. /// 审核者
  55. /// </summary>
  56. Reviewer,
  57. /// <summary>
  58. /// 共享者
  59. /// </summary>
  60. Sharer,
  61. /// <summary>
  62. /// 采集者
  63. /// </summary>
  64. Gatherer,
  65. }
  66. /// <summary>
  67. /// 图像类别
  68. /// </summary>
  69. public class ImageCategory : Entity
  70. {
  71. /// <summary>
  72. /// Gets or sets the name
  73. /// </summary>
  74. public string Name { get; set; }
  75. /// <summary>
  76. /// Gets or sets the level
  77. /// </summary>
  78. public CategoryLevel Level { get; set; }
  79. /// <summary>
  80. /// Gets or sets the parent hierarchy
  81. /// </summary>
  82. public EntityBase Parent { get; set; }
  83. /// <summary>
  84. /// Gets or sets the organization id
  85. /// </summary>
  86. public long OrganizationId { get; set; }
  87. /// <summary>
  88. /// Gets or sets the label package content id
  89. /// </summary>
  90. public long LabelPackageContentId { get; set; }
  91. /// <summary>
  92. /// Gets or sets the same batch label case id
  93. /// </summary>
  94. public long SameBatchLabelCaseId { get; set; }
  95. /// <summary>
  96. /// Gets or sets the labelers
  97. /// </summary>
  98. public List<EntityBase> Labelers { get; set; }
  99. /// <summary>
  100. /// Gets or sets the developers
  101. /// </summary>
  102. public List<EntityBase> Developers { get; set; }
  103. /// <summary>
  104. /// Gets or sets the sharers
  105. /// </summary>
  106. public List<EntityBase> Sharers { get; set; }
  107. /// <summary>
  108. /// Gets or sets the gatherers
  109. /// </summary>
  110. public List<EntityBase> Gatherers { get; set; }
  111. /// <summary>
  112. /// Gets or sets the image quantity item
  113. /// </summary>
  114. [Obsolete]
  115. public ImageQuantityItem ImageQuantityItem { get; set; }
  116. /// <summary>
  117. /// Gets or sets the gold standard file quantity item
  118. /// </summary>
  119. [Obsolete]
  120. public GoldStandardQuantityItem GoldStandardQuantityItem { get; set; }
  121. /// <summary>
  122. /// Gets or sets the self-check file quantity item
  123. /// </summary>
  124. [Obsolete]
  125. public SelfCheckQuantityItem SelfCheckQuantityItem { get; set; }
  126. /// <summary>
  127. /// Gets or sets the questioned labeled ultrasound files' quantity item
  128. /// </summary>
  129. [Obsolete]
  130. public ImageQuantityBase QuestionedQuantityItem { get; set; }
  131. /// <summary>
  132. /// Gets or sets the questioned labeled ultrasound files' quantity details
  133. /// </summary>
  134. [Obsolete]
  135. public List<QuestionedQuantityItem> QuestionedQuantityDetails { get; set; }
  136. /// <summary>
  137. /// Gets or sets whether category has children
  138. /// </summary>
  139. public bool HasChildren { get; set; }
  140. /// <summary>
  141. /// Gets or sets the value to indicate whether the labler is created due to the old labeled image data imported.
  142. /// If true, then the labler is only used for old images, can't use in any other situation.
  143. /// </summary>
  144. public bool IsImportedFormOldData { get; set; }
  145. /// <summary>
  146. /// Gets or sets the value to indicate whether the image does it support skip frame.
  147. /// </summary>
  148. public bool IsSupportedSkipFrame { get; set; }
  149. /// <summary>
  150. /// Gets or sets the video item
  151. /// </summary>
  152. public VideoItem VideoItem { get; set; }
  153. /// <summary>
  154. /// Gets or sets the group quantity item
  155. /// </summary>
  156. public QuantityItem GroupItem { get; set; }
  157. /// <summary>
  158. /// Gets or sets the file quantity item
  159. /// </summary>
  160. public QuantityItem FileItem { get; set; }
  161. /// <summary>
  162. /// Gets or sets the madal quantity items
  163. /// </summary>
  164. public List<ModalQuantityItem> ModalItems { get; set; }
  165. /// <summary>
  166. /// Gets or sets the Difficulty Level
  167. /// </summary>
  168. public DifficultyLevel DifficultyLevel { get; set; }
  169. /// <summary>
  170. /// Gets or sets the develop confirm info
  171. /// </summary>
  172. public DevelopConfirmInfo DevelopConfirmInfo { get; set; }
  173. public ImageCategory()
  174. {
  175. Labelers = new List<EntityBase>();
  176. Developers = new List<EntityBase>();
  177. Sharers = new List<EntityBase>();
  178. Gatherers = new List<EntityBase>();
  179. VideoItem = new VideoItem();
  180. GroupItem = new QuantityItem();
  181. FileItem = new QuantityItem();
  182. ModalItems = new List<ModalQuantityItem>();
  183. DevelopConfirmInfo = new DevelopConfirmInfo();
  184. }
  185. //overrid Name to Dispaly
  186. public override string ToString()
  187. {
  188. return Name;
  189. }
  190. }
  191. public class QuantityItem
  192. {
  193. /// <summary>
  194. /// Gets or sets the file quantity
  195. /// </summary>
  196. public ImageQuantityItem Quantity { get; set; }
  197. /// <summary>
  198. /// Gets or sets the gold standard file quantity
  199. /// </summary>
  200. public GoldStandardQuantityItem GoldStandardQuantity { get; set; }
  201. /// <summary>
  202. /// Gets or sets the self-check file quantity
  203. /// </summary>
  204. public SelfCheckQuantityItem SelfCheckQuantity { get; set; }
  205. /// <summary>
  206. /// Gets or sets the questioned labeled ultrasound files' quantity
  207. /// </summary>
  208. public ImageQuantityBase QuestionedQuantity { get; set; }
  209. /// <summary>
  210. /// Gets or sets the questioned labeled ultrasound files' quantity details
  211. /// </summary>
  212. public List<QuestionedQuantityItem> QuestionedQuantityDetails { get; set; }
  213. public QuantityItem()
  214. {
  215. Quantity = new ImageQuantityItem();
  216. QuestionedQuantity = new ImageQuantityBase();
  217. QuestionedQuantityDetails = new List<QuestionedQuantityItem>();
  218. }
  219. }
  220. public class ModalQuantityItem : QuantityItem
  221. {
  222. /// <summary>
  223. /// Gets or sets the label modal.
  224. /// </summary>s
  225. public LabelItemBase Modal { get; set; }
  226. }
  227. public class ImageQuantityBase
  228. {
  229. /// <summary>
  230. /// Gets or sets the files total
  231. /// </summary>
  232. [Display(Name = "总数")]
  233. public int Total { get; set; }
  234. /// <summary>
  235. /// Gets or sets the labeled files count
  236. /// </summary>
  237. [Display(Name = "已标注图像")]
  238. public int Labeled { get; set; }
  239. /// <summary>
  240. /// Gets or sets the files have seen count
  241. /// </summary>
  242. [Display(Name = "已看过图像")]
  243. public int Seen { get; set; }
  244. /// <summary>
  245. /// Gets or sets the files skipped count
  246. /// </summary>
  247. [Display(Name = "已跳过图像")]
  248. public int Skipped { get; set; }
  249. /// <summary>
  250. /// Gets or sets the unLabeled files count
  251. /// </summary>
  252. [Display(Name = "未标注图像")]
  253. public int UnLabeled { get; set; }
  254. /// <summary>
  255. /// Gets or sets the unAssigned files count
  256. /// </summary>
  257. [Display(Name = "未分配图像")]
  258. public int UnAssigned { get; set; }
  259. }
  260. /// <summary>
  261. /// 图像数量项
  262. /// </summary>
  263. public class ImageQuantityItem : ImageQuantityBase
  264. {
  265. /// <summary>
  266. /// Gets or sets the unAdoptable files count
  267. /// </summary>
  268. [Display(Name = "不合格图像")]
  269. public int UnAdoptable { get; set; }
  270. }
  271. /// <summary>
  272. /// 金标准数量项
  273. /// </summary>
  274. public class GoldStandardQuantityItem
  275. {
  276. /// <summary>
  277. /// Gets or sets the number of people up to standard
  278. /// </summary>
  279. [Display(Name = "达标人数")]
  280. public int QualifiedPeople { get; set; }
  281. /// <summary>
  282. /// Gets or sets the proportion of the gold standard files
  283. /// </summary>
  284. [Display(Name = "占总数中的比例")]
  285. public double Proportion { get; set; }
  286. /// <summary>
  287. /// Gets or sets the existing quantity of gold standard files
  288. /// </summary>
  289. [Display(Name = "已有数量")]
  290. public int Existing { get; set; }
  291. /// <summary>
  292. /// Gets or sets the gold standard files to be added quantity
  293. /// </summary>
  294. [Display(Name = "还需添加数量")]
  295. public int ToBeAdded { get; set; }
  296. }
  297. /// <summary>
  298. /// 自校验数量项
  299. /// </summary>
  300. public class SelfCheckQuantityItem
  301. {
  302. /// <summary>
  303. /// Gets or sets the proportion of the self-check files
  304. /// </summary>
  305. [Display(Name = "占总数中的比例")]
  306. public double Proportion { get; set; }
  307. }
  308. /// <summary>
  309. /// 质疑数量详情
  310. /// </summary>
  311. public class QuestionedQuantityItem : ImageQuantityBase
  312. {
  313. /// <summary>
  314. /// Gets or sets the labeler
  315. /// </summary>
  316. public EntityBase Labeler { get; set; }
  317. }
  318. public class VideoItem
  319. {
  320. [Display(Name = "视频标注帧模式")]
  321. public FrameMode FrameMode { get; set; }
  322. [Display(Name = "间隔帧数")]
  323. public int IntervalFrame { get; set; }
  324. [Display(Name = "相似度阈值")]
  325. public double SimilarityThreshold { get; set; }
  326. public VideoItem()
  327. {
  328. IntervalFrame = 1;
  329. }
  330. }
  331. }