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

物体検出結果の枠線の色選択のリファクタリング #1

Open
rsobt opened this issue Apr 2, 2022 · 0 comments
Open

Comments

@rsobt
Copy link

rsobt commented Apr 2, 2022

【概要】
関数のリファクタリングの提案

【詳細】

def make_color(labels):
# 枠線の色をランダムに決定
colors = [[random.randint(0, 255) for _ in range(3)] for _ in labels]
color = random.choice(colors)
return color

上記の関数は以下の関数と同様の動作をすると考えています。

 def make_color(): 
     # 枠線の色をランダムに決定 
     return [random.randint(0, 255) for _ in range(3)] 

これに伴い呼び出しはmake_color()になります。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant