Skip to content

Commit

Permalink
Convert seed 'range' into a list
Browse files Browse the repository at this point in the history
This fixes a bug later in in e.g., style_mixing_example where
ranges are concatened together with the +-operator.

Add .gitignore file.
  • Loading branch information
jannehellsten committed Feb 5, 2020
1 parent 4874628 commit cec605e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.stylegan2-cache/
__pycache__/
2 changes: 1 addition & 1 deletion run_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def _parse_num_range(s):
range_re = re.compile(r'^(\d+)-(\d+)$')
m = range_re.match(s)
if m:
return range(int(m.group(1)), int(m.group(2))+1)
return list(range(int(m.group(1)), int(m.group(2))+1))
vals = s.split(',')
return [int(x) for x in vals]

Expand Down
2 changes: 1 addition & 1 deletion run_projector.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _parse_num_range(s):
range_re = re.compile(r'^(\d+)-(\d+)$')
m = range_re.match(s)
if m:
return range(int(m.group(1)), int(m.group(2))+1)
return list(range(int(m.group(1)), int(m.group(2))+1))
vals = s.split(',')
return [int(x) for x in vals]

Expand Down

0 comments on commit cec605e

Please sign in to comment.