Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
crawler
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chengyang Zhong
crawler
Commits
88a69b79
Commit
88a69b79
authored
Jan 01, 2021
by
haowang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
d1b63291
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
29 deletions
+27
-29
__init__.py
tasks/zhihu/captcha/__init__.py
+0
-2
utils.py
tasks/zhihu/captcha/utils.py
+24
-24
zhihu_captcha.py
tasks/zhihu/captcha/zhihu_captcha.py
+3
-3
No files found.
tasks/zhihu/captcha/__init__.py
View file @
88a69b79
from
zhihu_captcha
import
zhihu_captcha
\ No newline at end of file
tasks/zhihu/captcha/utils.py
View file @
88a69b79
...
@@ -9,38 +9,38 @@ num_classes = 38#3 + 2 + 10 + 1 + 1
...
@@ -9,38 +9,38 @@ num_classes = 38#3 + 2 + 10 + 1 + 1
maxPrintLen
=
100
maxPrintLen
=
100
tf
.
app
.
flags
.
DEFINE_boolean
(
'restore'
,
True
,
'whether to restore from the latest checkpoint'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_boolean
(
'restore'
,
True
,
'whether to restore from the latest checkpoint'
)
tf
.
app
.
flags
.
DEFINE_string
(
'checkpoint_dir'
,
'./checkpoint/'
,
'the checkpoint dir'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_string
(
'checkpoint_dir'
,
'./checkpoint/'
,
'the checkpoint dir'
)
tf
.
app
.
flags
.
DEFINE_float
(
'initial_learning_rate'
,
1e-3
,
'inital lr'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_float
(
'initial_learning_rate'
,
1e-3
,
'inital lr'
)
tf
.
app
.
flags
.
DEFINE_integer
(
'image_height'
,
60
,
'image height'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_integer
(
'image_height'
,
60
,
'image height'
)
tf
.
app
.
flags
.
DEFINE_integer
(
'image_width'
,
150
,
'image width'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_integer
(
'image_width'
,
150
,
'image width'
)
tf
.
app
.
flags
.
DEFINE_integer
(
'image_channel'
,
1
,
'image channels as input'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_integer
(
'image_channel'
,
1
,
'image channels as input'
)
tf
.
app
.
flags
.
DEFINE_integer
(
'max_stepsize'
,
64
,
'max stepsize in lstm, as well as '
tf
.
compat
.
v1
.
flags
.
DEFINE_integer
(
'max_stepsize'
,
64
,
'max stepsize in lstm, as well as '
'the output channels of last layer in CNN'
)
'the output channels of last layer in CNN'
)
tf
.
app
.
flags
.
DEFINE_integer
(
'num_hidden'
,
128
,
'number of hidden units in lstm'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_integer
(
'num_hidden'
,
128
,
'number of hidden units in lstm'
)
tf
.
app
.
flags
.
DEFINE_integer
(
'num_epochs'
,
1000
,
'maximum epochs'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_integer
(
'num_epochs'
,
1000
,
'maximum epochs'
)
tf
.
app
.
flags
.
DEFINE_integer
(
'batch_size'
,
128
,
'the batch_size'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_integer
(
'batch_size'
,
128
,
'the batch_size'
)
tf
.
app
.
flags
.
DEFINE_integer
(
'save_steps'
,
500
,
'the step to save checkpoint'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_integer
(
'save_steps'
,
500
,
'the step to save checkpoint'
)
tf
.
app
.
flags
.
DEFINE_integer
(
'validation_steps'
,
500
,
'the step to validation'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_integer
(
'validation_steps'
,
500
,
'the step to validation'
)
tf
.
app
.
flags
.
DEFINE_float
(
'decay_rate'
,
0.98
,
'the lr decay rate'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_float
(
'decay_rate'
,
0.98
,
'the lr decay rate'
)
tf
.
app
.
flags
.
DEFINE_float
(
'beta1'
,
0.9
,
'parameter of adam optimizer beta1'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_float
(
'beta1'
,
0.9
,
'parameter of adam optimizer beta1'
)
tf
.
app
.
flags
.
DEFINE_float
(
'beta2'
,
0.999
,
'adam parameter beta2'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_float
(
'beta2'
,
0.999
,
'adam parameter beta2'
)
tf
.
app
.
flags
.
DEFINE_integer
(
'decay_steps'
,
1000
,
'the lr decay_step for optimizer'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_integer
(
'decay_steps'
,
1000
,
'the lr decay_step for optimizer'
)
tf
.
app
.
flags
.
DEFINE_float
(
'momentum'
,
0.9
,
'the momentum'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_float
(
'momentum'
,
0.9
,
'the momentum'
)
tf
.
app
.
flags
.
DEFINE_string
(
'train_dir'
,
'./imgs/train/'
,
'the train data dir'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_string
(
'train_dir'
,
'./imgs/train/'
,
'the train data dir'
)
tf
.
app
.
flags
.
DEFINE_string
(
'val_dir'
,
'./imgs/val/'
,
'the val data dir'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_string
(
'val_dir'
,
'./imgs/val/'
,
'the val data dir'
)
tf
.
app
.
flags
.
DEFINE_string
(
'infer_dir'
,
'./imgs/infer/'
,
'the infer data dir'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_string
(
'infer_dir'
,
'./imgs/infer/'
,
'the infer data dir'
)
tf
.
app
.
flags
.
DEFINE_string
(
'logs_dir'
,
'./log'
,
'the logging dir'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_string
(
'logs_dir'
,
'./log'
,
'the logging dir'
)
tf
.
app
.
flags
.
DEFINE_string
(
'mode'
,
'train'
,
'train, val or infer'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_string
(
'mode'
,
'train'
,
'train, val or infer'
)
tf
.
app
.
flags
.
DEFINE_integer
(
'num_gpus'
,
1
,
'num of gpus'
)
tf
.
compat
.
v1
.
flags
.
DEFINE_integer
(
'num_gpus'
,
1
,
'num of gpus'
)
FLAGS
=
tf
.
app
.
flags
.
FLAGS
FLAGS
=
tf
.
compat
.
v1
.
flags
.
FLAGS
# num_batches_per_epoch = int(num_train_samples/FLAGS.batch_size)
# num_batches_per_epoch = int(num_train_samples/FLAGS.batch_size)
...
...
tasks/zhihu/captcha/zhihu_captcha.py
View file @
88a69b79
...
@@ -8,9 +8,9 @@ import urllib.parse
...
@@ -8,9 +8,9 @@ import urllib.parse
import
webbrowser
import
webbrowser
from
io
import
BytesIO
from
io
import
BytesIO
from
zhihu_
captcha
import
utils
from
captcha
import
utils
from
zhihu_
captcha
import
orcmodel
from
captcha
import
orcmodel
import
tensorflow
as
tf
import
tensorflow
.compat.v1
as
tf
from
PIL
import
Image
from
PIL
import
Image
import
numpy
as
np
import
numpy
as
np
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment