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

5.4 KiB

In [1]:
import importlib  
ac = importlib.import_module("projects.annotation-compass.annotation_compass")
In [2]:
print(ac)
<module 'projects.annotation-compass.annotation_compass' from '/var/www/html/si16-app/projects/annotation-compass/annotation_compass.py'>
In [3]:
ac.get_labels_url('greek.jpg')
Out[3]:
{'response': 'ok',
 'labels': [{'position': {'x': 71.4815, 'y': 13.4748},
   'size': {'width': 51.6667, 'height': 70.9862},
   'text': 'love after love\n\nthe time will come\nthat with ecstacy\nyou will welcome your self\nas you will reach at your own door, at your own mirror,\nand the one while smiling will welcome the other\n\nand stay here they would say. eat.\nyou will love again the stranger that your self was.\ngive some wine. give some bread. give back your heart.\nto herself, to the stranger that loved you\n\nall your life, that you avoided\nfor someone else, that had mirrored you.\nput down the love poems from the shelf,\n\nthe photos, the desperate notes,\ntear down your image from the mirror.\nsit down. enjoy your life.',
   'timestamp': datetime.datetime(2021, 12, 15, 10, 57, 24),
   'userID': '8990638769',
   'image': 'greek.jpg'},
  {'position': {'x': 76.5434, 'y': -0.71048},
   'size': {'width': 7.74749, 'height': 87.9218},
   'text': 'μ\nι\nτ\n   σ\nα\n\n\nγ\nι\nρ\nν   π\nα   η\n    σ\n    ο\n\n\nι\n\n \nεσ\n  τ\n   ο\n\nτ\n υ\nλ  \n   ε\nφ\nο\n     ν\nα\n\n   ',
   'timestamp': datetime.datetime(2021, 12, 17, 12, 56, 4),
   'userID': '7152574796',
   'image': 'greek.jpg'},
  {'position': {'x': 83.1432, 'y': 4.08526},
   'size': {'width': 28.264, 'height': 87.7442},
   'text': "Μ\n  Ι\nΤ\n      Σ\nΑ\n\n\n           Γ    Ι\n        Ρ\n           Ν \n            Α\n\n\nΠ   \n     Ι\nΣ\nΟ\n\n\n\nΙ'\n\n\n\n        Ε\nΣ\nΤ\n              Ο\n\n\n\n         Τ    \nΥ\n Λ Ε\n       ΦΟ\nΝ\n  Α\n\n\n\n                        Φ\n\n ",
   'timestamp': datetime.datetime(2021, 12, 17, 12, 59, 43),
   'userID': '7152574796',
   'image': 'greek.jpg'}]}
In [4]:
ac.get_image_description('greek.jpg')
/var/www/html/si16-app/projects/annotation-compass/descriptions.json
Out[4]:
"Welcome to many to one translation!\r\n\r\nI would like you to translate this poem to english. You can use a translator to obtain the translation of single words, but i hope you will do your best to make a thoughtful choice on the word you will choose. Every word has its own power!\r\n\r\nThis collection of translations will be part of the material I will use to experiment with my mashup() function, that can be used only with texts with the same number of lines. Therefore, I kindly ask you to create the spaces next to the text, in order, and one space per line. This is so that the content extracted will be ready to be processed.\r\n\r\n    .b Click and drag to create the space where you want to insert your translation (line by line, in order, one space per line)\r\n    .c Click ''insert'' or click on the ''x'' if it's not as you want\r\n\r\nThank you for your participation!\r\nGet back on our website soon to see how your contribution has been used."
In [7]:
 
/var/www/html/si16-app
In [ ]: