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

Segmentation #677

Merged
merged 99 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
efae20b
Updated filter and rank
Apr 20, 2023
c5ae7ef
Unchanged. Pushed for testing
Apr 20, 2023
65e55d3
Code typed out, need to check
Apr 21, 2023
d37e55f
Done with code?
Apr 24, 2023
088d248
Pushing
Apr 24, 2023
2d208c0
Check
Apr 24, 2023
268be4d
Final push
Apr 24, 2023
a39c2ae
filter by class error
Apr 24, 2023
7c47d58
parentesis
Apr 24, 2023
53ecd84
now?
Apr 24, 2023
75daf1b
Fixed axes in display
Apr 24, 2023
1dc48da
Fixed by_class
Apr 24, 2023
6ceb09b
Update rank.py
vdlad Apr 25, 2023
6010b8a
Fixed type and returned pxlscres"num_pixel_issues"
Apr 26, 2023
6a75c84
fixed optional for type
Apr 26, 2023
942f855
finished type fix
Apr 26, 2023
fe470e6
fixed error
Apr 29, 2023
5dd4e9c
Done?
Apr 29, 2023
9506826
dont code at 1am
Apr 29, 2023
ceaefe2
fixed ranking return of pixel scores
Apr 29, 2023
3839a15
Apply suggestions from code review
vdlad May 7, 2023
f4e77a4
Typos in fixes
May 7, 2023
1cffaa4
First set of edits!
May 7, 2023
2314660
Second set of changes
May 8, 2023
f1ae8f5
Check if code still works
May 8, 2023
bebb090
fixed circular import
May 8, 2023
ef31784
black
May 8, 2023
1a8148f
Added legend
Jun 6, 2023
c33275b
black
Jun 6, 2023
0550549
Kwargs, import
Jun 6, 2023
8e7d65d
Unused
Jun 6, 2023
ad9a005
Type check
Jun 6, 2023
cde47e6
black
Jun 6, 2023
b1164da
Fixed black formatting
ulya-tkch Jun 7, 2023
2c6a5a6
Added testing (codecov) framework + fixed format
ulya-tkch Jun 7, 2023
46b41e2
black and pixels
Jun 7, 2023
83bb1c0
Softmin code opt
Jun 7, 2023
4755c84
black
Jun 7, 2023
0aa661b
black
Jun 7, 2023
8a6edda
fix df summary
Jun 7, 2023
954fd29
tutorial
Jun 7, 2023
2613b0a
added one test
Jun 7, 2023
0e828bf
added a test
Jun 7, 2023
9becf26
Review tutorial notebook + add TODOS
ulya-tkch Jun 7, 2023
bebeef4
Merge branch 'master' of https://github.com/vdlad/cleanlab into uly-u…
ulya-tkch Jun 7, 2023
19eb748
stash
Jun 7, 2023
858d408
Merge branch 'master' of https://github.com/cleanlab/cleanlab
Jun 7, 2023
5bba20c
Add docstring build
ulya-tkch Jun 7, 2023
f81b6e4
Added my first test
Jun 8, 2023
b51c732
Added my first test
Jun 8, 2023
b9a88a9
added tests and swapped h and w
Jun 8, 2023
bb316a0
Merge branch 'master' of https://github.com/cleanlab/cleanlab
Jun 8, 2023
af3592b
tests/removed venv
Jun 8, 2023
03104c9
added check for _label
Jun 8, 2023
457284f
re-fix
Jun 8, 2023
5634138
fixed rank
Jun 8, 2023
32f2667
finished rank tests
Jun 8, 2023
8272734
cases
Jun 8, 2023
a4db45f
done with rank now
Jun 8, 2023
ec185b7
black
Jun 8, 2023
192c197
more black
Jun 8, 2023
0093301
value errors for issues
Jun 8, 2023
b9c348b
more test cases
Jun 8, 2023
9cab290
added None case
Jun 8, 2023
5c2cccd
Done with rank and filter tests
Jun 8, 2023
430ecba
fixed given_label==predicted_label bug
Jun 9, 2023
3552328
rename
Jun 9, 2023
5d8fc75
rename
Jun 9, 2023
1a22338
finished tut
Jun 9, 2023
9bd5532
Add summary tests
ulya-tkch Jun 9, 2023
2c2b5e6
Udate tutorial notebook mini gramar edits/working
ulya-tkch Jun 9, 2023
de21c04
Merge branch 'master' into master
ulya-tkch Jun 9, 2023
345da7c
small fixes
Jun 9, 2023
111a6d8
Apply suggestions from code review
vdlad Jun 9, 2023
d500af4
Update index.rst
vdlad Jun 9, 2023
3ad57ca
Add deleted test
ulya-tkch Jun 9, 2023
5414869
fixed the scores only and other docstrings
Jun 9, 2023
254a2f5
black
Jun 9, 2023
e0211d7
Merge branch 'master' of github.com:vdlad/cleanlab
Jun 9, 2023
04dae61
Increase codecov
ulya-tkch Jun 9, 2023
54ae54d
downsampled
Jun 10, 2023
557faf9
Merge branch 'master' of github.com:vdlad/cleanlab
Jun 10, 2023
acd1b61
tutorial done
Jun 10, 2023
c210900
got rid of scores only test
Jun 10, 2023
3cae619
downsample to kwarg
Jun 10, 2023
71a1fc2
black
Jun 10, 2023
dabda9b
different size input
Jun 10, 2023
29af6d9
bug fix
Jun 10, 2023
7cb6aaf
black+bug
Jun 10, 2023
0d2c1a2
fixed tutorial?
Jun 10, 2023
2bfa220
Clear nb output for tutorial
ulya-tkch Jun 12, 2023
8fb8240
Improve docstrings
ulya-tkch Jun 12, 2023
f409e4e
Add extra tests + functions for checking Optional args
ulya-tkch Jun 12, 2023
f6577d2
tutorial language and clarity
jwmueller Jun 13, 2023
6a9e012
fix broken notebook formatting
jwmueller Jun 13, 2023
e3362b4
Update parameter names
ulya-tkch Jun 14, 2023
7fc6a11
Update tutorial notebook with unit tests, review wording
ulya-tkch Jun 14, 2023
ccb3597
Fixed logic in display
ulya-tkch Jun 19, 2023
ba4f57a
Merge branch 'master' of https://github.com/cleanlab/cleanlab
ulya-tkch Jun 20, 2023
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
Prev Previous commit
Next Next commit
small fixes
  • Loading branch information
vdlad committed Jun 9, 2023
commit 345da7cea0a5dc499a5bcf985c03bbf83a8147d0
6 changes: 3 additions & 3 deletions cleanlab/segmentation/rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ def get_label_quality_scores(

batch_size : int,
For num_pixel_issues:
Size of mini-batches to use for estimating the label issues.
Size of mini-batches to use for estimating the label issues for 'num_pixel_issues' only, not 'softmin'
To maximize efficiency, try to use the largest `batch_size` your memory allows.

n_jobs: int,
For num_pixel_issues:
Number of processes for multiprocessing (default value = 1). Only used on Linux.
Number of processes for multiprocessing (default value = 1). Only used on Linux. For 'num_pixel_issues' only, not 'softmin'
If `n_jobs=None`, will use either the number of: physical cores if psutil is installed, or logical cores otherwise.

verbose : bool,
Expand All @@ -76,7 +76,7 @@ def get_label_quality_scores(

**kwargs:
downsample : int,
Factor to shrink labels and pred_probs by for 'num_pixel_issues' only . Default ``16``
Factor to shrink labels and pred_probs by for 'num_pixel_issues' only, not 'softmin' . Default ``16``
Must be a factor divisible by both the labels and the pred_probs. Note that larger factors result in a linear
decrease in performance

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about the batch_size for find_label_issues()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I don't follow - find_label_issues has a batch_size argument

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that I am saying that the downsample does not work for the softmin method - maybe I should clarify that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't resolve conversations involving a question, I will not see answer if you resolve it.

Here you are allowing user to specify downsample argument via get_label_quality_scores(), and I am proposing you should also allow user to specify batch_size argument. I get that both arguments would only apply when the method is num_pixel_issues and would be ignored if it is softmin.

And yes please explicitly mention that in docstring

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right - there is a batch_size argument for get_label_quality_scores() - am I misunderstanding something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry! resolved cause both get_label_quality_scores() and find_label_issues() both have a downsamples and batch_size argument

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean I should offer downsample in get_label_quality_scores() as an argument and not as a kwarg?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should both be kwargs or not. It does not make sense for one to be kwarg and the other not. I prefer both being kwargs.

They should both be at the end of the arguments list too and docstring should clarify: These arguments are only considered when method = "num_pixel_issues"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally don't split up arguments that only apply in a special case in the arg order between other args that always apply

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we talked about this earlier and this is what we came to because for find_label_issues() needs downsampling to be worthwhile and the default method for get_label_quality_score() is softmin.

If we make them both kwargs then what would you suggest the default downsample value to be? Right now it is 16, but if that number is not divisible by their image dimensions then it will fail and the user would have to go then set the kwarg which seems annoying to do.

If we make downsample a kwarg for both methods, then I feel the default should be 1 or 2. Which are more likely to be a factor of the dimension. Thoughts?

Expand Down
2 changes: 1 addition & 1 deletion cleanlab/segmentation/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def display_issues(
if labels is not None and len(exclude) != 0:
mask = ~np.isin(labels[i], exclude)
ax.imshow(issues[i] & mask, cmap=error_cmap, vmin=0, vmax=1)
ax.set_title(f"Image Index ({i}) Suggested Errors (Red)")
ax.set_title(f"Image {i}: Suggested Errors (in Red)")
plt.show()

plot_index = 0
Expand Down