image-keypoints.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. const config = `
  2. <View>
  3. <Image name="img" value="$image" zoom="true"></Image>
  4. <KeyPointLabels name="tag" toName="img" strokewidth="5" fillcolor="red">
  5. <Label value="Hello" background="yellow"></Label>
  6. <Label value="World" background="blue"></Label>
  7. </KeyPointLabels>
  8. </View>
  9. `;
  10. const data = {
  11. image: "https://data.heartex.net/open-images/train_0/mini/0030019819f25b28.jpg",
  12. };
  13. const result = [
  14. {
  15. id: "hqudA4A3U4",
  16. from_name: "tag",
  17. to_name: "img",
  18. image_rotation: 0,
  19. original_height: 576,
  20. original_width: 768,
  21. type: "keypointlabels",
  22. origin: "manual",
  23. value: {
  24. x: 49.60000000000001,
  25. y: 52.34042553191488,
  26. width: 0.6120428759942558,
  27. keypointlabels: ["Hello"],
  28. },
  29. },
  30. {
  31. id: "Rz9oHDXIwG",
  32. from_name: "tag",
  33. to_name: "img",
  34. image_rotation: 0,
  35. original_height: 576,
  36. original_width: 768,
  37. type: "keypointlabels",
  38. origin: "manual",
  39. value: {
  40. x: 47.73333333333334,
  41. y: 52.765957446808514,
  42. width: 0.6305418719211823,
  43. keypointlabels: ["World"],
  44. },
  45. },
  46. ];
  47. const title = "Keypoints on Image";
  48. module.exports = { config, data, result, title };