Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Issue & 3.x Version main.py #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
OPERATIONS = [Rotate, FlipH, FlipV, Translate, Noise, Zoom, Blur]

'''
Issue
: 1. This Program Python 2.7 version
2. You may need this -> download http://scikit-image.org/download for "from skimage import transform"
3. Other things -> (pip : scipy, numpy, scikit-image | easy_install : six)
4. If you using 3.x version Python, look at the 177 line this code

Augmented files will have names matching the regex below, eg

original__rot90__crop1__flipv.jpg
Expand Down Expand Up @@ -103,3 +109,47 @@ def process(dir, file, op_lists):
thread_pool.join()

print counter.get()
'''
End To 2.7 Version
'''

'''
Change Code's For 3.x Version Python (# : line numberic, @ : Original, $ : Change Code)

# 3 line
@ from multiprocessing.dummy import Pool, cpu_count
$ from multiprocessing.dummy import Pool
import multiprocessing as mp
# 15 line
@ WORKER_COUNT = max(cpu_count() - 1, 1)
$ WORKER_COUNT = max(mp.cpu_count() - 1, 1)
# 58 line
@ print 'Usage: {} <image directory> <operation> (<operation> ...)'.format(sys.argv[0])
$ print ('Usage: {} <image directory> <operation> (<operation> ...)'.format(sys.argv[0]))
# 59 line
@ sys.exit(1)
$ os._exit(1)
# 63 line
@ print 'Invalid image directory: {}'.format(image_dir)
$ print ('Invalid image directory: {}'.format(image_dir))
# 64 line
@ sys.exit(2)
$ os._exit(2)
# 79 line
@ print 'Unknown operation {}'.format(op_code)
$ print ('Unknown operation {}'.format(op_code))
# 85 line
@ print 'Thread pool initialised with {} worker{}'.format(WORKER_COUNT, '' if WORKER_COUNT == 1 else 's')
$ print ('Thread pool initialised with {} worker{}'.format(WORKER_COUNT, '' if WORKER_COUNT == 1 else 's'))
# 90 line
@ print 'Processing {}...'.format(dir_name)
$ print ('Processing {}...'.format(dir_name))
# 101 line
@ print "Waiting for workers to complete..."
$ print ("Waiting for workers to complete...")
# 105 line
@ print counter.get()
$ print (counter.get())

Abuout 3.x version other issue -> emails : laguz1254@gmail.com
'''