Changeset - 79c410b194c6
[Not reviewed]
default
0 1 0
Laman - 6 years ago 2018-12-20 22:03:39

sampler takes command line arguments
1 file changed with 10 insertions and 4 deletions:
0 comments (0 inline, 0 general)
exp/color_sampler.py
Show inline comments
 
@@ -15,11 +15,15 @@ from analyzer.epoint import EPoint
 
from analyzer.corners import Corners
 

	
 

	
 
dirname=sys.argv[1]
 
annotations=sys.argv[2]
 

	
 

	
 
class Sampler:
 
	def __init__(self):
 
		self.dirname="../images"
 
		self.annotations=DataFile("annotations.json.gz")
 
		self.filenames=[f for f in os.listdir(self.dirname) if f.endswith(".jpg")]
 
		self.dirname=dirname
 
		self.annotations=DataFile(annotations)
 
		self.filenames=[f for f in sorted(os.listdir(self.dirname)) if f.endswith(".jpg")]
 
		self.k=0
 

	
 
		self.img=None
 
@@ -129,6 +133,7 @@ class Sampler:
 

	
 

	
 
class DataFile(MutableMapping):
 
	"""self._data: {filename: [EPoint,EPoint,EPoint,EPoint]}"""
 
	def __init__(self,filename):
 
		self.filename=filename
 
		try:
 
@@ -157,4 +162,5 @@ class DataFile(MutableMapping):
 
	def __len__(self): return len(self._data)
 

	
 

	
 
s=Sampler()
 
if __name__=="__main__":
 
	s=Sampler()
0 comments (0 inline, 0 general)