osma commited on
Commit
726e841
1 Parent(s): 912fd70

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +1 -0
  2. collect-hkm.py +68 -0
  3. images/hkm.00049815-1E48-4C06-8C23-C5C8DA9F11BA.jpg +3 -0
  4. images/hkm.000BC921-3333-425F-AD9D-4F6DF8F1F411.jpg +3 -0
  5. images/hkm.001AC4AD-E464-45E1-AE48-B2916B0F7524.jpg +3 -0
  6. images/hkm.001F7288-7A39-40E4-921C-4033293F73CD.jpg +3 -0
  7. images/hkm.003214A7-C9E3-4951-94E8-CEE331475A8C.jpg +3 -0
  8. images/hkm.004E3D8D-50E5-4B81-BD51-5A81FCA714C1.jpg +3 -0
  9. images/hkm.0069A920-2691-49D5-BE25-210129FC6D0A.jpg +3 -0
  10. images/hkm.006F286C-7241-4748-BACD-489C6ADA966D.jpg +3 -0
  11. images/hkm.00721F34-2A86-448E-881F-4EBA0327FB97.jpg +3 -0
  12. images/hkm.0083CA2B-02BF-409D-98E5-04A0E0453920.jpg +3 -0
  13. images/hkm.008E5E30-D694-436F-8B8A-C3717CD6B8C8.jpg +3 -0
  14. images/hkm.009E59F0-AB45-4C4E-8780-2ABB600FC6FE.jpg +3 -0
  15. images/hkm.00BE3BF4-DDF1-4D1E-9452-B9F4D50EB40C.jpg +3 -0
  16. images/hkm.00C06CBD-E131-45DA-9098-3ED818A585B7.jpg +3 -0
  17. images/hkm.00C752D8-9AA9-4E6D-BA00-A6F2E1EBF72C.jpg +3 -0
  18. images/hkm.00CB1696-837A-4384-8065-56F4AB6A1FE4.jpg +3 -0
  19. images/hkm.00CC9DF9-1FB8-4EF4-A98D-1306D48D5E01.jpg +3 -0
  20. images/hkm.00EC3CE5-83BD-42D7-9C8A-A1AC35A2F21C.jpg +3 -0
  21. images/hkm.00EF822A-3099-4D95-A7CF-A33C13018ED2.jpg +3 -0
  22. images/hkm.00F5B548-533E-4FCB-A0E2-2FB6346EA941.jpg +3 -0
  23. images/hkm.00F71433-FE53-49F4-BA19-62B2B6034385.jpg +3 -0
  24. images/hkm.00FB174C-B6BA-4D45-BC6B-FF54D100FB5A.jpg +3 -0
  25. images/hkm.010FE51C-4B74-49CE-88A7-C24C5F923EE5.jpg +3 -0
  26. images/hkm.011FA394-2B5D-48A1-B9AE-AEE6753221C7.jpg +3 -0
  27. images/hkm.012DA954-AEF5-44A4-8421-4F3D6BF3C3DF.jpg +3 -0
  28. images/hkm.01399904-4F0B-4805-874F-FC143482458D.jpg +3 -0
  29. images/hkm.013E0CE7-A27F-4992-B918-5A62CE90EBE0.jpg +3 -0
  30. images/hkm.014624B7-55D8-44F1-ADC7-2EBF8B949D30.jpg +3 -0
  31. images/hkm.0149F821-1BF5-4A07-8C3C-A50153A299EB.jpg +3 -0
  32. images/hkm.01613A3B-26BF-4157-BF37-E541A7C794D7.jpg +3 -0
  33. images/hkm.016D5459-E301-43B9-8989-E18D21DE1AAB.jpg +3 -0
  34. images/hkm.0172C85E-BDDE-40F8-AF57-3956C635B036.jpg +3 -0
  35. images/hkm.017AD274-A42E-42B5-AC00-A99190E90662.jpg +3 -0
  36. images/hkm.017C0614-4163-40A9-8E2A-133ABB97BD7B.jpg +3 -0
  37. images/hkm.01805E8E-2755-43E4-B9DB-53889287A7A9.jpg +3 -0
  38. images/hkm.0186A715-313F-4DF5-B87E-7F5622C91C8B.jpg +3 -0
  39. images/hkm.0199CC6B-4B90-4A03-88E8-2E9E41DCDF55.jpg +3 -0
  40. images/hkm.01A662EE-FC26-4445-8BC8-8A43F81DFB7F.jpg +3 -0
  41. images/hkm.01AA53A2-72CC-420E-9D88-ED64965A4049.jpg +3 -0
  42. images/hkm.01C0F957-A172-46A8-AE3F-9EFCBD9490FE.jpg +3 -0
  43. images/hkm.01CC675A-96BD-466B-AD4C-C7B806FBF954.jpg +3 -0
  44. images/hkm.01D21A8B-5EDC-4400-AABE-282E2B070138.jpg +3 -0
  45. images/hkm.01DFE437-53A6-469B-8C00-69931A2A6E97.jpg +3 -0
  46. images/hkm.01E0C8B0-1DC4-4ADF-9FC6-46EA3401E307.jpg +3 -0
  47. images/hkm.01FA3AAA-91CE-4532-AB45-E655DFBF5A84.jpg +3 -0
  48. images/hkm.02003654-0BCD-447B-9FF6-BD89BE783AA3.jpg +3 -0
  49. images/hkm.021af2db-7b12-4933-88fc-0fe62e74ebbc.jpg +3 -0
  50. images/hkm.0221F59E-6F33-49FB-9EAB-4E19F8E9F4CB.jpg +3 -0
.gitattributes CHANGED
@@ -53,3 +53,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
53
  *.jpg filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
 
 
53
  *.jpg filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
56
+ metadata.jsonl filter=lfs diff=lfs merge=lfs -text
collect-hkm.py ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ from finna_client import FinnaClient, IMAGE_BASE
4
+ import requests
5
+ import json
6
+ import os
7
+ import os.path
8
+ import logging
9
+
10
+ finna = FinnaClient()
11
+ logging.basicConfig(format='%(asctime)s - %(message)s', level=logging.INFO)
12
+
13
+ MAX_YEAR = 1917 # retrieve only images older than this (inclusive)
14
+ IMAGE_DIR = 'images'
15
+
16
+ # Facet filters that define the set of images we want to
17
+ FILTERS = [
18
+ '~format_ext_str_mv:"1/Image/Photo/"', # Photographs
19
+ '~building:"0/HKM/"', # from HKM (Helsinki City Museum)
20
+ '~usage_rights_ext_str_mv:"0/B BY/"', # CC By license
21
+ f'search_daterange_mv:"overlap|[* TO {MAX_YEAR}]"', # date up to MAX_YEAR
22
+ ]
23
+
24
+ # Fields to include in the metadata records
25
+ FIELDS = [
26
+ 'formats',
27
+ 'id',
28
+ 'imageRights',
29
+ 'images',
30
+ 'languages',
31
+ 'nonPresenterAuthors',
32
+ 'onlineUrls',
33
+ 'presenters',
34
+ 'rating',
35
+ 'series',
36
+ 'subjects',
37
+ 'title',
38
+ 'year',
39
+ 'rawData',
40
+ ]
41
+
42
+ def download_url_to_file(url, filename):
43
+ if os.path.exists(filename) and os.stat(filename).st_size > 0:
44
+ return # file already exists, no need to re-download
45
+ with requests.get(url, stream=True) as r:
46
+ r.raise_for_status()
47
+ with open(filename, 'wb') as f:
48
+ for chunk in r.iter_content(chunk_size=8192):
49
+ f.write(chunk)
50
+
51
+ with open('metadata.jsonl', 'w') as outfile:
52
+ page = 1
53
+
54
+ while True:
55
+ logging.info(f'Loading result page {page}')
56
+ result = finna.search(filters=FILTERS, fields=FIELDS, page=page)
57
+ if 'records' not in result:
58
+ logging.info('No more records, stopping.')
59
+ break
60
+ logging.debug(f'Got {len(result["records"])} records')
61
+ for record in result['records']:
62
+ image_url = IMAGE_BASE + record['images'][0]
63
+ image_file_out = os.path.join(IMAGE_DIR, record['id'] + '.jpg')
64
+ download_url_to_file(image_url, image_file_out)
65
+ record['file_name'] = image_file_out
66
+ json.dump(record, outfile)
67
+ print("", file=outfile)
68
+ page += 1
images/hkm.00049815-1E48-4C06-8C23-C5C8DA9F11BA.jpg ADDED

Git LFS Details

  • SHA256: fc5a436ecc7217c64f9fe1008de03ecbed63c2631a72623bf8cdfde9dc527b70
  • Pointer size: 131 Bytes
  • Size of remote file: 339 kB
images/hkm.000BC921-3333-425F-AD9D-4F6DF8F1F411.jpg ADDED

Git LFS Details

  • SHA256: dcfbb2ed3228b76f5a021057cd252d04f2fea585c18ab6525bec7a5e4647b0f4
  • Pointer size: 131 Bytes
  • Size of remote file: 294 kB
images/hkm.001AC4AD-E464-45E1-AE48-B2916B0F7524.jpg ADDED

Git LFS Details

  • SHA256: 03da703d8e89c9f16dd558423d2c4ebe711881aab6a12680b1f8f0b1f06aa28c
  • Pointer size: 131 Bytes
  • Size of remote file: 242 kB
images/hkm.001F7288-7A39-40E4-921C-4033293F73CD.jpg ADDED

Git LFS Details

  • SHA256: 24fbf60f247c6d159d23aec3861e589a7d1af2d14241533b27a777de9f5a9881
  • Pointer size: 131 Bytes
  • Size of remote file: 255 kB
images/hkm.003214A7-C9E3-4951-94E8-CEE331475A8C.jpg ADDED

Git LFS Details

  • SHA256: 00a36e8d8795272728e4f75c51e583d7f4106e2f3ba2ede32b76163828d3537d
  • Pointer size: 131 Bytes
  • Size of remote file: 329 kB
images/hkm.004E3D8D-50E5-4B81-BD51-5A81FCA714C1.jpg ADDED

Git LFS Details

  • SHA256: bf682f358a081fd519d67fbd6c0490f6e5d12870d191123dcb0870190d6cb2c4
  • Pointer size: 131 Bytes
  • Size of remote file: 187 kB
images/hkm.0069A920-2691-49D5-BE25-210129FC6D0A.jpg ADDED

Git LFS Details

  • SHA256: 94716ed324b0090d1fc5fee6e6dc2668efbe30e26c81058903a3ea0927407330
  • Pointer size: 131 Bytes
  • Size of remote file: 236 kB
images/hkm.006F286C-7241-4748-BACD-489C6ADA966D.jpg ADDED

Git LFS Details

  • SHA256: 6846b7881118b850a6f1801fb32a8300d7f60ba407009b7a688783d78ecdbe6a
  • Pointer size: 131 Bytes
  • Size of remote file: 316 kB
images/hkm.00721F34-2A86-448E-881F-4EBA0327FB97.jpg ADDED

Git LFS Details

  • SHA256: c9445cc9ecba60cc70c7a0ee908950bf325826682a9b78ae4f15655c7aa84feb
  • Pointer size: 131 Bytes
  • Size of remote file: 274 kB
images/hkm.0083CA2B-02BF-409D-98E5-04A0E0453920.jpg ADDED

Git LFS Details

  • SHA256: 96bd60893788e4e8612743c931067d5e2e09144eb6efb4009cc8e2441b2bf03f
  • Pointer size: 131 Bytes
  • Size of remote file: 195 kB
images/hkm.008E5E30-D694-436F-8B8A-C3717CD6B8C8.jpg ADDED

Git LFS Details

  • SHA256: 102cc4e57af7fbf74b9495e4b01b60e69c3a5a900ab615186854637131989196
  • Pointer size: 131 Bytes
  • Size of remote file: 323 kB
images/hkm.009E59F0-AB45-4C4E-8780-2ABB600FC6FE.jpg ADDED

Git LFS Details

  • SHA256: f7804bcb62aa4680bdf7dfe4c1bccd624149534e4af92812c8f9bec5105851b5
  • Pointer size: 131 Bytes
  • Size of remote file: 251 kB
images/hkm.00BE3BF4-DDF1-4D1E-9452-B9F4D50EB40C.jpg ADDED

Git LFS Details

  • SHA256: 6619e9eb98866195b076fdb6f7f8bf7f314d000edda1cddb410e943bc008c948
  • Pointer size: 131 Bytes
  • Size of remote file: 202 kB
images/hkm.00C06CBD-E131-45DA-9098-3ED818A585B7.jpg ADDED

Git LFS Details

  • SHA256: 9d254eba3f72423691ead60186736da22bd757d0da1f834f35dd041fd6a1e71e
  • Pointer size: 131 Bytes
  • Size of remote file: 317 kB
images/hkm.00C752D8-9AA9-4E6D-BA00-A6F2E1EBF72C.jpg ADDED

Git LFS Details

  • SHA256: c9f17235bcd3a1a67989a7a4bcb257254cd49ba8bf4b7a80b631c583d81e6e5d
  • Pointer size: 131 Bytes
  • Size of remote file: 438 kB
images/hkm.00CB1696-837A-4384-8065-56F4AB6A1FE4.jpg ADDED

Git LFS Details

  • SHA256: d7d9b4ec90fd94d25ae552cd56124d991829aea2003a20255d74942dfe4ebd2b
  • Pointer size: 131 Bytes
  • Size of remote file: 220 kB
images/hkm.00CC9DF9-1FB8-4EF4-A98D-1306D48D5E01.jpg ADDED

Git LFS Details

  • SHA256: 1c7e19ec0d1881db1cc54106a96dd017404247a1a7bc3a5671f0f67d75ab29bf
  • Pointer size: 131 Bytes
  • Size of remote file: 292 kB
images/hkm.00EC3CE5-83BD-42D7-9C8A-A1AC35A2F21C.jpg ADDED

Git LFS Details

  • SHA256: 7db7cc2262211fd5a5733b3301915cfc133b161269a220adbbb6d2aa0f866f1d
  • Pointer size: 131 Bytes
  • Size of remote file: 316 kB
images/hkm.00EF822A-3099-4D95-A7CF-A33C13018ED2.jpg ADDED

Git LFS Details

  • SHA256: 0b59275854bb225ee86fd46929078535babe84f121b3eb673f1105b7664f4548
  • Pointer size: 131 Bytes
  • Size of remote file: 336 kB
images/hkm.00F5B548-533E-4FCB-A0E2-2FB6346EA941.jpg ADDED

Git LFS Details

  • SHA256: 03da97623d68d7055edf6a238e0121d3292ac5107a7273d724eddbd70c55a5b3
  • Pointer size: 131 Bytes
  • Size of remote file: 260 kB
images/hkm.00F71433-FE53-49F4-BA19-62B2B6034385.jpg ADDED

Git LFS Details

  • SHA256: 8c1035244c44c3358d8c5fb8ac0bcfb8b2bb34829863fee80065f4d4a192631d
  • Pointer size: 131 Bytes
  • Size of remote file: 276 kB
images/hkm.00FB174C-B6BA-4D45-BC6B-FF54D100FB5A.jpg ADDED

Git LFS Details

  • SHA256: 732909822bd4e7dd845d493be777746729db2a9cdad5598425b1aaab1e1d045d
  • Pointer size: 131 Bytes
  • Size of remote file: 285 kB
images/hkm.010FE51C-4B74-49CE-88A7-C24C5F923EE5.jpg ADDED

Git LFS Details

  • SHA256: edd585edb522ea2faed6a72516af4932c82772b55a1af276902d63207124287c
  • Pointer size: 131 Bytes
  • Size of remote file: 168 kB
images/hkm.011FA394-2B5D-48A1-B9AE-AEE6753221C7.jpg ADDED

Git LFS Details

  • SHA256: 97b1d11953990048c1b4be40ca51d556faa2a598b12df0fcc892560357316778
  • Pointer size: 131 Bytes
  • Size of remote file: 290 kB
images/hkm.012DA954-AEF5-44A4-8421-4F3D6BF3C3DF.jpg ADDED

Git LFS Details

  • SHA256: e996e9e47d40498034a0681be3f728ee98a10e008e750ef16c280bb32b0c5a96
  • Pointer size: 131 Bytes
  • Size of remote file: 247 kB
images/hkm.01399904-4F0B-4805-874F-FC143482458D.jpg ADDED

Git LFS Details

  • SHA256: d048be3b30b0af8b8c1f25d25b9fbedf1e03b58761bb80960f3fa48fa56c7fd4
  • Pointer size: 131 Bytes
  • Size of remote file: 200 kB
images/hkm.013E0CE7-A27F-4992-B918-5A62CE90EBE0.jpg ADDED

Git LFS Details

  • SHA256: 3a5007a751691cd5abdc220539b8eafda21928d6c74357b30101accb50829e55
  • Pointer size: 131 Bytes
  • Size of remote file: 273 kB
images/hkm.014624B7-55D8-44F1-ADC7-2EBF8B949D30.jpg ADDED

Git LFS Details

  • SHA256: 40ae774159bff2e3aa36e0cce6d11cdaefa4623d238786404a67f76d430ea0e3
  • Pointer size: 131 Bytes
  • Size of remote file: 469 kB
images/hkm.0149F821-1BF5-4A07-8C3C-A50153A299EB.jpg ADDED

Git LFS Details

  • SHA256: 5fba2b19ef23f6f8dad895fd2c7f2bb588aaa0aa91779001f756c0f0f84361ca
  • Pointer size: 131 Bytes
  • Size of remote file: 191 kB
images/hkm.01613A3B-26BF-4157-BF37-E541A7C794D7.jpg ADDED

Git LFS Details

  • SHA256: b848672a7a5472679ac5e70dfa5fb4342804c2909f9f525bbd2cd93c33f8c85c
  • Pointer size: 131 Bytes
  • Size of remote file: 329 kB
images/hkm.016D5459-E301-43B9-8989-E18D21DE1AAB.jpg ADDED

Git LFS Details

  • SHA256: fa493f420a478e43885b2f7e3eeae3716db1ee575e00bb2a92489529f0972d51
  • Pointer size: 131 Bytes
  • Size of remote file: 215 kB
images/hkm.0172C85E-BDDE-40F8-AF57-3956C635B036.jpg ADDED

Git LFS Details

  • SHA256: ce0c37dd795d83417c1d11d2a1fca59329e507e897aa96d1e4bbbb69bcaa2409
  • Pointer size: 131 Bytes
  • Size of remote file: 338 kB
images/hkm.017AD274-A42E-42B5-AC00-A99190E90662.jpg ADDED

Git LFS Details

  • SHA256: de03597d4d20152115d1e635f2b33cad06b3a22f7b95801ec7de4f56dd73e35c
  • Pointer size: 131 Bytes
  • Size of remote file: 253 kB
images/hkm.017C0614-4163-40A9-8E2A-133ABB97BD7B.jpg ADDED

Git LFS Details

  • SHA256: 98022a5652766cc50e993a41c891fd7cbd65646703e9af1b04d6aadaffe0f504
  • Pointer size: 131 Bytes
  • Size of remote file: 334 kB
images/hkm.01805E8E-2755-43E4-B9DB-53889287A7A9.jpg ADDED

Git LFS Details

  • SHA256: 0c23bd71e45a51e57c99884e9169090834e00dd2bbfdcb7d27f5a143cb16b463
  • Pointer size: 131 Bytes
  • Size of remote file: 315 kB
images/hkm.0186A715-313F-4DF5-B87E-7F5622C91C8B.jpg ADDED

Git LFS Details

  • SHA256: 7495c0be1750a23c5cbaacd27c8a4e7b7787b482cc328606cde1abc248fc22cf
  • Pointer size: 131 Bytes
  • Size of remote file: 273 kB
images/hkm.0199CC6B-4B90-4A03-88E8-2E9E41DCDF55.jpg ADDED

Git LFS Details

  • SHA256: 0f8fc86dcc33336d3c8a237c2bcc16fbb9c6d0b1bb3aa51fcee7a39df86ac960
  • Pointer size: 131 Bytes
  • Size of remote file: 356 kB
images/hkm.01A662EE-FC26-4445-8BC8-8A43F81DFB7F.jpg ADDED

Git LFS Details

  • SHA256: 4ae6091a9574f907f2db973e88db9516a7e6887eb0b19b0798e2b3fbb04c1c42
  • Pointer size: 131 Bytes
  • Size of remote file: 249 kB
images/hkm.01AA53A2-72CC-420E-9D88-ED64965A4049.jpg ADDED

Git LFS Details

  • SHA256: 2ab8d339679a954270e80ed4bd64c46b77a39c733ea9e09cf164520461ea25c8
  • Pointer size: 131 Bytes
  • Size of remote file: 316 kB
images/hkm.01C0F957-A172-46A8-AE3F-9EFCBD9490FE.jpg ADDED

Git LFS Details

  • SHA256: e3531d59787dacad3e782ecb404c5932599310302deefc131d70146d5aa3216d
  • Pointer size: 131 Bytes
  • Size of remote file: 328 kB
images/hkm.01CC675A-96BD-466B-AD4C-C7B806FBF954.jpg ADDED

Git LFS Details

  • SHA256: 2c96d0e92f2267d1acc499bdab9aada2fbe69970e07aa3fbd3ca552b5d1d50bb
  • Pointer size: 131 Bytes
  • Size of remote file: 260 kB
images/hkm.01D21A8B-5EDC-4400-AABE-282E2B070138.jpg ADDED

Git LFS Details

  • SHA256: 436f1b90589807569084446473db600b673f0695351086a930068b9e1f4b310f
  • Pointer size: 131 Bytes
  • Size of remote file: 368 kB
images/hkm.01DFE437-53A6-469B-8C00-69931A2A6E97.jpg ADDED

Git LFS Details

  • SHA256: 5b04bb9ee26300beb109b08b3197c92538800b1f213bb0da3bddd38fc6017b6c
  • Pointer size: 131 Bytes
  • Size of remote file: 256 kB
images/hkm.01E0C8B0-1DC4-4ADF-9FC6-46EA3401E307.jpg ADDED

Git LFS Details

  • SHA256: 1007eef6ff3bb37e474965ac4789627c3fe9ba32b2599ee3ef315ce747fd7e28
  • Pointer size: 131 Bytes
  • Size of remote file: 275 kB
images/hkm.01FA3AAA-91CE-4532-AB45-E655DFBF5A84.jpg ADDED

Git LFS Details

  • SHA256: 070a5f70eec280625b895e3497b4bfbf026b2b0f806ad9a04a9e4adfd339297e
  • Pointer size: 131 Bytes
  • Size of remote file: 272 kB
images/hkm.02003654-0BCD-447B-9FF6-BD89BE783AA3.jpg ADDED

Git LFS Details

  • SHA256: 5e8cc4027fde02b1e1e3ee9c758f22095696942dd0477e60202368414d2ba445
  • Pointer size: 131 Bytes
  • Size of remote file: 208 kB
images/hkm.021af2db-7b12-4933-88fc-0fe62e74ebbc.jpg ADDED

Git LFS Details

  • SHA256: 1b1301f7f4f02d2d00d819119cf64895e72ad6d15438c819c34b939264b5948d
  • Pointer size: 131 Bytes
  • Size of remote file: 123 kB
images/hkm.0221F59E-6F33-49FB-9EAB-4E19F8E9F4CB.jpg ADDED

Git LFS Details

  • SHA256: 0064ba506472cfe39a2a90a6fd2bf1a5cb6edbb853b9f182d115e5897faa7a7f
  • Pointer size: 131 Bytes
  • Size of remote file: 313 kB