sartq333 commited on
Commit
50e974c
·
1 Parent(s): 05e676b
Files changed (1) hide show
  1. face_parsing.py +6 -6
face_parsing.py CHANGED
@@ -7,14 +7,14 @@ from PIL import ImageOps
7
  import matplotlib.pyplot as plt
8
 
9
  def segmentation(input_img_path):
10
- with open('face-parsing/config.json', 'r') as file:
11
- data = json.load(file)
12
 
13
- for key, value in data["id2label"].items():
14
- print(f"{key}: {value}")
15
 
16
- image_processor = SegformerImageProcessor.from_pretrained("face-parsing")
17
- model = SegformerForSemanticSegmentation.from_pretrained("face-parsing")
18
 
19
  # input_img_path = "akshay kumar img.jpeg"
20
  if isinstance(input_img_path, str): # It's a path
 
7
  import matplotlib.pyplot as plt
8
 
9
  def segmentation(input_img_path):
10
+ #with open('face-parsing/config.json', 'r') as file:
11
+ # data = json.load(file)
12
 
13
+ #for key, value in data["id2label"].items():
14
+ #print(f"{key}: {value}")
15
 
16
+ image_processor = SegformerImageProcessor.from_pretrained("jonathandinu/face-parsing")
17
+ model = SegformerForSemanticSegmentation.from_pretrained("jonathandinu/face-parsing")
18
 
19
  # input_img_path = "akshay kumar img.jpeg"
20
  if isinstance(input_img_path, str): # It's a path