Builder.py 680 B

123456789101112131415161718192021
  1. from . import ImageDB
  2. import os, json
  3. class Builder(object):
  4. """description of class"""
  5. def __init__(self):
  6. self.config = None
  7. def compute(self,db,src):
  8. # CSV file should NOT still exist
  9. if db.csvFileName:
  10. if os.path.isfile(db.csvFileName): print("WARNING[miam.imageDB.Builder.compute(...):",db.csvFileName," already exists! It will be overwritten!]")
  11. # config file
  12. if db.jsonConfigFile:
  13. with open(db.jsonConfigFile) as json_file:
  14. self.config = json.load(json_file)
  15. else:
  16. print("ERROR[miam.imageDB.Builder.compute(...):",db.jsonConfigFile," does not exist !]")