Skip to content

Commit b3f98a7

Browse files
committed
style
1 parent 6bd0b4c commit b3f98a7

File tree

1 file changed

+9
-28
lines changed

1 file changed

+9
-28
lines changed

examples/research_projects/anytext/pipeline_anytext.py

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright 2024 The HuggingFace Team. All rights reserved.
2+
# Copyright (c) Alibaba, Inc. and its affiliates.
23
#
34
# Licensed under the Apache License, Version 2.0 (the "License");
45
# you may not use this file except in compliance with the License.
@@ -20,7 +21,11 @@
2021

2122

2223
import inspect
24+
import math
25+
import os
2326
import re
27+
import sys
28+
from functools import partial
2429
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
2530

2631
import cv2
@@ -29,8 +34,12 @@
2934
import torch
3035
import torch.nn.functional as F
3136
from bert_tokenizer import BasicTokenizer
37+
from easydict import EasyDict as edict
3238
from frozen_clip_embedder_t3 import FrozenCLIPEmbedderT3
39+
from ocr_recog.RecModel import RecModel
3340
from PIL import Image, ImageDraw, ImageFont
41+
from safetensors.torch import load_file
42+
from skimage.transform._geometric import _umeyama as get_sym_mat
3443
from torch import nn
3544
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer, CLIPVisionModelWithProjection
3645

@@ -102,15 +111,6 @@
102111
```
103112
"""
104113

105-
"""
106-
Copyright (c) Alibaba, Inc. and its affiliates.
107-
"""
108-
from functools import partial
109-
110-
import torch
111-
import torch.nn as nn
112-
from safetensors.torch import load_file
113-
114114

115115
def get_clip_token_for_string(tokenizer, string):
116116
batch_encoding = tokenizer(
@@ -205,25 +205,6 @@ def embedding_parameters(self):
205205
return self.parameters()
206206

207207

208-
209-
"""
210-
Copyright (c) Alibaba, Inc. and its affiliates.
211-
"""
212-
import math
213-
import os
214-
import sys
215-
import time
216-
import traceback
217-
218-
import cv2
219-
import numpy as np
220-
import torch
221-
import torch.nn.functional as F
222-
from easydict import EasyDict as edict
223-
from ocr_recog.RecModel import RecModel
224-
from skimage.transform._geometric import _umeyama as get_sym_mat
225-
226-
227208
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
228209

229210

0 commit comments

Comments
 (0)