Skip to content

Commit

Permalink
Initialize repo.
Browse files Browse the repository at this point in the history
Signed-off-by: Wang, Yang <[email protected]>
  • Loading branch information
yangwang201911 committed May 27, 2023
1 parent ab81530 commit d920b16
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions convert_img_to_dna.py → Image2DNA.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,14 @@ def process_directory(dir_path):
convert_dna_list_to_jpeg(file_path)
print("Processing the DNA sequence file wihtin {}...Done".format(file_path))

# 判断路径是文件还是目录,并调用相应的处理函数
if os.path.isfile(args.path):
convert_jpeg_to_dna_list(args.path)
elif os.path.isdir(args.path):
process_directory(args.path)
else:
print(f'{args.path} is not a file or directory')
def main():
# 判断路径是文件还是目录,并调用相应的处理函数
if os.path.isfile(args.path):
convert_jpeg_to_dna_list(args.path)
elif os.path.isdir(args.path):
process_directory(args.path)
else:
print(f'{args.path} is not a file or directory')

if __name__ == '__main__':
main()
Binary file added images_sample/input.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d920b16

Please sign in to comment.