Fix EndpointHandler class name and remove PIL dependencies
Browse files- handler.py +2 -7
handler.py
CHANGED
|
@@ -3,15 +3,10 @@ import sys
|
|
| 3 |
import json
|
| 4 |
import torch
|
| 5 |
import numpy as np
|
| 6 |
-
from PIL import Image, ImageDraw
|
| 7 |
-
import io
|
| 8 |
-
import base64
|
| 9 |
from typing import Dict, Any, List
|
| 10 |
-
import tempfile
|
| 11 |
-
import xml.etree.ElementTree as ET
|
| 12 |
import math
|
| 13 |
|
| 14 |
-
class
|
| 15 |
def __init__(self, path=""):
|
| 16 |
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 17 |
|
|
@@ -288,4 +283,4 @@ class DiffSketcherHandler:
|
|
| 288 |
paths.append(f'<line x1="{x1}" y1="{y1}" x2="{x2}" y2="{y2}" stroke="{color}" stroke-width="{stroke_width}" opacity="{opacity}"/>')
|
| 289 |
|
| 290 |
# Create handler instance
|
| 291 |
-
handler =
|
|
|
|
| 3 |
import json
|
| 4 |
import torch
|
| 5 |
import numpy as np
|
|
|
|
|
|
|
|
|
|
| 6 |
from typing import Dict, Any, List
|
|
|
|
|
|
|
| 7 |
import math
|
| 8 |
|
| 9 |
+
class EndpointHandler:
|
| 10 |
def __init__(self, path=""):
|
| 11 |
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 12 |
|
|
|
|
| 283 |
paths.append(f'<line x1="{x1}" y1="{y1}" x2="{x2}" y2="{y2}" stroke="{color}" stroke-width="{stroke_width}" opacity="{opacity}"/>')
|
| 284 |
|
| 285 |
# Create handler instance
|
| 286 |
+
handler = EndpointHandler()
|