jsup.GEN - working on image-to-image generation with AI

Image
by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/jsup-gen-working-on-image-to-image-generation-with-ai Hello, this is @joviansummer(witness: @jswit). I'd like to share what I'm working on regarding my experintal jsup.GEN project, which tries to connect image generation AI with Steemit. Currently, jsup.GEN provide function to generate image from test prompt(txt2img). This function is interesting, but it's not easy to generate exactly what you want because you need to explain the image in detail with multiple keywords in English. Thus, I think it's more useful to have a function to generate image from existing reference image. I'm working on this image-to-image function, and thinking about two methods to implement it. The first method is to provide 2 commands as follows: !gen_t : This command focuses more on text prompt than reference image. The result may be quite different from reference because text prompt will have much more in...

파이썬에서 실행 명령에 인자(argument) 지정

by joviansummer
original STEEMIT post: https://steemit.com/blog/@joviansummer/argument


파이썬 스크립트를 실행할 때 실행 명령에 인자(argument)를 지정할 수 있습니다. 예를 들어 인자를 확인해서 이를 그대로 출력하는 스크립트 test.py를 만든다고 생각해 보겠습니다.

아래와 같은 실행 결과를 주는 스크립트입니다.

python3 test.py hello

test.py hello

python3 test.py hello world

test.py hello world

위의 스크립트는 아래와 같은 내용으로 작성되었습니다.

import sys

for arg in sys.argv:
  print(arg)

실행 명령의 인자는 sys.argv에 저장되며, 리스트(list) 형식입니다. 위의 예시에서는 for 반복문으로 sys.argv[0]부터 차례로 출력하였습니다.

2번째 예시의 경우(실행 명령: python3 test.py hello world) sys.argv에는 아래와 같이 값이 할당될 것입니다.

sys.argv[0]: 'test.py'(스크립트의 이름) sys.argv[1]: 'hello' (첫번째 인자) sys.argv[2]: 'world' (2번째 인자)

Comments

Popular posts from this blog

스티미언의 영향력 지수 계산

jsup/avle code update - you don't have to write post everyday

jsup/avle 보팅 코드 갱신 - 1일1포스팅 강박에서 벗어나기