BunkerMinecraft commited on
Commit
1eacefd
·
verified ·
1 Parent(s): c2fac1c

Update inference.py

Browse files
Files changed (1) hide show
  1. inference.py +4 -2
inference.py CHANGED
@@ -3,8 +3,10 @@ import json
3
  from PIL import Image
4
  import numpy as np
5
 
6
- with open("config.json") as f:
7
- cfg = json.load(f)
 
 
8
 
9
  class_names = ['battery', 'glass', 'metal', 'organic', 'paper', 'plastic']
10
 
 
3
  from PIL import Image
4
  import numpy as np
5
 
6
+ cfg = None
7
+ if os.path.exists("config.json"):
8
+ with open("config.json") as f:
9
+ cfg = json.load(f)
10
 
11
  class_names = ['battery', 'glass', 'metal', 'organic', 'paper', 'plastic']
12