image-bboxes.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. const config = `
  2. <View>
  3. <Image name="img" value="$image"></Image>
  4. <RectangleLabels name="tag" toName="img" fillOpacity="0.5" strokeWidth="5">
  5. <Label value="Hello"></Label>
  6. <Label value="World" background="blue"></Label>
  7. </RectangleLabels>
  8. </View>
  9. `;
  10. const data = {
  11. image:
  12. "https://htx-pub.s3.us-east-1.amazonaws.com/examples/images/nick-owuor-astro-nic-visuals-wDifg5xc9Z4-unsplash.jpg",
  13. };
  14. const result = [
  15. {
  16. from_name: "tag",
  17. id: "Dx_aB91ISN",
  18. image_rotation: 0,
  19. original_height: 2802,
  20. original_width: 2242,
  21. to_name: "img",
  22. type: "rectanglelabels",
  23. origin: "manual",
  24. value: {
  25. height: 10.458911419423693,
  26. rectanglelabels: ["Hello"],
  27. rotation: 0,
  28. width: 12.4,
  29. x: 50.8,
  30. y: 5.86979722518676,
  31. },
  32. },
  33. {
  34. from_name: "tag",
  35. id: "Dx_aB92ISN",
  36. image_rotation: 0,
  37. original_height: 2802,
  38. original_width: 2242,
  39. to_name: "img",
  40. type: "rectanglelabels",
  41. origin: "manual",
  42. value: {
  43. height: 10.458911419423693,
  44. rectanglelabels: ["World"],
  45. rotation: 0,
  46. width: 12.4,
  47. x: 55.8,
  48. y: 15.86979722518676,
  49. },
  50. },
  51. ];
  52. const title = "BBoxes on Image";
  53. module.exports = { config, data, result, title };