yashkant commited on
Commit
1ead5e3
·
verified ·
1 Parent(s): 6bcf319

Upload domainnet/test_split.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. domainnet/test_split.py +11 -0
domainnet/test_split.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import random
2
+ domains = ["clipart", "infograph", "painting", "quickdraw", "real", "sketch"]
3
+
4
+ random.seed(42)
5
+ for domain in domains:
6
+ with open(domain + '_test.txt', 'r') as f:
7
+ domain_data = f.readlines()
8
+ random.shuffle(domain_data)
9
+
10
+ with open(domain + '_test_fold.txt', 'w') as f:
11
+ f.write("".join(domain_data))